mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-03-30 15:08:33 +00:00
[NOD-1532] ResolveBlockStatus should return the blockStatus
This commit is contained in:
parent
7050ebeac9
commit
c994200878
@ -15,11 +15,17 @@ func (csm *consensusStateManager) resolveBlockStatus(blockHash *externalapi.Doma
|
||||
return 0, err
|
||||
}
|
||||
|
||||
// If there's no unverified blocks in the given block's chain - this means the given block already has a
|
||||
// UTXO-verified status, and therefore it should be retrieved from the store and returned
|
||||
if len(unverifiedBlocks) == 0 {
|
||||
return csm.blockStatusStore.Get(csm.databaseContext, blockHash)
|
||||
}
|
||||
|
||||
var blockStatus externalapi.BlockStatus
|
||||
// resolve the unverified blocks' statuses in opposite order
|
||||
for i := len(unverifiedBlocks) - 1; i >= 0; i-- {
|
||||
unverifiedBlockHash := unverifiedBlocks[i]
|
||||
|
||||
var blockStatus externalapi.BlockStatus
|
||||
if selectedParentStatus == externalapi.StatusDisqualifiedFromChain {
|
||||
blockStatus = externalapi.StatusDisqualifiedFromChain
|
||||
} else {
|
||||
@ -33,7 +39,7 @@ func (csm *consensusStateManager) resolveBlockStatus(blockHash *externalapi.Doma
|
||||
selectedParentStatus = blockStatus
|
||||
}
|
||||
|
||||
return 0, nil
|
||||
return blockStatus, nil
|
||||
}
|
||||
|
||||
func (csm *consensusStateManager) getUnverifiedChainBlocksAndSelectedParentStatus(blockHash *externalapi.DomainHash) (
|
||||
|
Loading…
x
Reference in New Issue
Block a user