This commit is contained in:
Ori Newman 2025-02-17 10:03:24 +01:00 committed by GitHub
commit 36576fc272
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1387,16 +1387,9 @@ out:
case processBlockMsg: case processBlockMsg:
_, isOrphan, err := sm.chain.ProcessBlock( _, isOrphan, err := sm.chain.ProcessBlock(
msg.block, msg.flags) msg.block, msg.flags)
if err != nil {
msg.reply <- processBlockResponse{
isOrphan: false,
err: err,
}
}
msg.reply <- processBlockResponse{ msg.reply <- processBlockResponse{
isOrphan: isOrphan, isOrphan: isOrphan,
err: nil, err: err,
} }
case isCurrentMsg: case isCurrentMsg:
@ -1642,7 +1635,7 @@ func (sm *SyncManager) SyncPeerID() int32 {
// ProcessBlock makes use of ProcessBlock on an internal instance of a block // ProcessBlock makes use of ProcessBlock on an internal instance of a block
// chain. // chain.
func (sm *SyncManager) ProcessBlock(block *btcutil.Block, flags blockchain.BehaviorFlags) (bool, error) { func (sm *SyncManager) ProcessBlock(block *btcutil.Block, flags blockchain.BehaviorFlags) (bool, error) {
reply := make(chan processBlockResponse, 1) reply := make(chan processBlockResponse)
sm.msgChan <- processBlockMsg{block: block, flags: flags, reply: reply} sm.msgChan <- processBlockMsg{block: block, flags: flags, reply: reply}
response := <-reply response := <-reply
return response.isOrphan, response.err return response.isOrphan, response.err