|
|
@ -657,6 +657,8 @@ func (consensus *Consensus) NeedsBlockRecovery(blockNum uint64) bool { |
|
|
|
switch { |
|
|
|
switch { |
|
|
|
case blockNum == ReProposeBlockNumShard0 && consensus.ShardID == 0: |
|
|
|
case blockNum == ReProposeBlockNumShard0 && consensus.ShardID == 0: |
|
|
|
return true |
|
|
|
return true |
|
|
|
|
|
|
|
case blockNum == ReProposeBlockNumShard1 && consensus.ShardID == 1: |
|
|
|
|
|
|
|
return true |
|
|
|
case blockNum == ReProposeBlockNumShard2 && consensus.ShardID == 2: |
|
|
|
case blockNum == ReProposeBlockNumShard2 && consensus.ShardID == 2: |
|
|
|
return true |
|
|
|
return true |
|
|
|
} |
|
|
|
} |
|
|
@ -668,6 +670,8 @@ func (consensus *Consensus) RecoveryBlockNumber(shardID uint32) uint64 { |
|
|
|
switch { |
|
|
|
switch { |
|
|
|
case consensus.ShardID == 0: |
|
|
|
case consensus.ShardID == 0: |
|
|
|
return ReProposeBlockNumShard0 |
|
|
|
return ReProposeBlockNumShard0 |
|
|
|
|
|
|
|
case consensus.ShardID == 1: |
|
|
|
|
|
|
|
return ReProposeBlockNumShard1 |
|
|
|
case consensus.ShardID == 2: |
|
|
|
case consensus.ShardID == 2: |
|
|
|
return ReProposeBlockNumShard2 |
|
|
|
return ReProposeBlockNumShard2 |
|
|
|
} |
|
|
|
} |
|
|
|