peer: don't inv trickle new blocks
This commit is contained in:
parent
a741b4366b
commit
9a30e95d83
1 changed files with 13 additions and 1 deletions
14
peer/peer.go
14
peer/peer.go
|
@ -1723,7 +1723,19 @@ out:
|
|||
case iv := <-p.outputInvChan:
|
||||
// No handshake? They'll find out soon enough.
|
||||
if p.VersionKnown() {
|
||||
invSendQueue.PushBack(iv)
|
||||
// If this is a new block, then we'll blast it
|
||||
// out immediately, sipping the inv trickle
|
||||
// queue.
|
||||
if iv.Type == wire.InvTypeBlock ||
|
||||
iv.Type == wire.InvTypeWitnessBlock {
|
||||
|
||||
invMsg := wire.NewMsgInvSizeHint(1)
|
||||
invMsg.AddInvVect(iv)
|
||||
waiting = queuePacket(outMsg{msg: invMsg},
|
||||
pendingMsgs, waiting)
|
||||
} else {
|
||||
invSendQueue.PushBack(iv)
|
||||
}
|
||||
}
|
||||
|
||||
case <-trickleTicker.C:
|
||||
|
|
Loading…
Reference in a new issue