remove redundant sending to msg.reply in processBlockMsg in blockHandler

This commit is contained in:
Ori Newman 2020-02-11 09:57:18 +02:00
parent f3ec13030e
commit c617c3536a

View file

@ -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