mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-03-30 15:08:33 +00:00
[NOD-1538] Fix isBlockInHeaderPruningPointFuture. (#1094)
This commit is contained in:
parent
14d7ab5fc6
commit
213be67c47
@ -161,5 +161,9 @@ func (csm *consensusStateManager) HeaderTipsPruningPoint() (*externalapi.DomainH
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return csm.dagTraversalManager.HighestChainBlockBelowBlueScore(virtualHeaderHash, virtualHeaderGHOSTDAGData.BlueScore-csm.pruningDepth)
|
||||
blueScore := virtualHeaderGHOSTDAGData.BlueScore - csm.pruningDepth
|
||||
if csm.pruningDepth > virtualHeaderGHOSTDAGData.BlueScore {
|
||||
blueScore = 0
|
||||
}
|
||||
return csm.dagTraversalManager.HighestChainBlockBelowBlueScore(virtualHeaderHash, blueScore)
|
||||
}
|
||||
|
@ -188,6 +188,10 @@ func (sm *syncManager) isHeaderOnlyBlock(blockHash *externalapi.DomainHash) (boo
|
||||
}
|
||||
|
||||
func (sm *syncManager) isBlockInHeaderPruningPointFuture(blockHash *externalapi.DomainHash) (bool, error) {
|
||||
if *blockHash == *sm.genesisBlockHash {
|
||||
return false, nil
|
||||
}
|
||||
|
||||
exists, err := sm.blockStatusStore.Exists(sm.databaseContext, blockHash)
|
||||
if err != nil {
|
||||
return false, err
|
||||
|
Loading…
x
Reference in New Issue
Block a user