Skip to content

Commit

Permalink
Merge pull request #235 from kcalvinalvin/2025-01-07-modify-haveblock…
Browse files Browse the repository at this point in the history
…-behavior

blockchain: change HaveBlock behavior
  • Loading branch information
kcalvinalvin authored Jan 7, 2025
2 parents 82c08ea + 621de7b commit 538c3fc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions blockchain/blockindex.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,9 @@ func newBlockIndex(db database.DB, chainParams *chaincfg.Params) *blockIndex {
// This function is safe for concurrent access.
func (bi *blockIndex) HaveBlock(hash *chainhash.Hash) bool {
bi.RLock()
_, hasBlock := bi.index[*hash]
node, hasBlock := bi.index[*hash]
bi.RUnlock()
return hasBlock
return hasBlock && node.status.HaveData()
}

// LookupNode returns the block node identified by the provided hash. It will
Expand Down

0 comments on commit 538c3fc

Please sign in to comment.