mirror of
https://github.com/btcsuite/btcd.git
synced 2025-03-13 11:35:52 +01:00
Merge c617c3536a
into bb52d7d78d
This commit is contained in:
commit
36576fc272
1 changed files with 2 additions and 9 deletions
|
@ -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
|
||||||
|
|
Loading…
Add table
Reference in a new issue