mirror of
https://github.com/btcsuite/btcd.git
synced 2025-02-21 22:11:56 +01:00
remove redundant sending to msg.reply in processBlockMsg in blockHandler
This commit is contained in:
parent
f3ec13030e
commit
c617c3536a
1 changed files with 2 additions and 9 deletions
|
@ -1308,16 +1308,9 @@ out:
|
|||
case processBlockMsg:
|
||||
_, isOrphan, err := sm.chain.ProcessBlock(
|
||||
msg.block, msg.flags)
|
||||
if err != nil {
|
||||
msg.reply <- processBlockResponse{
|
||||
isOrphan: false,
|
||||
err: err,
|
||||
}
|
||||
}
|
||||
|
||||
msg.reply <- processBlockResponse{
|
||||
isOrphan: isOrphan,
|
||||
err: nil,
|
||||
err: err,
|
||||
}
|
||||
|
||||
case isCurrentMsg:
|
||||
|
@ -1539,7 +1532,7 @@ func (sm *SyncManager) SyncPeerID() int32 {
|
|||
// ProcessBlock makes use of ProcessBlock on an internal instance of a block
|
||||
// chain.
|
||||
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}
|
||||
response := <-reply
|
||||
return response.isOrphan, response.err
|
||||
|
|
Loading…
Add table
Reference in a new issue