peer: don't inv trickle new blocks

This commit is contained in:
Olaoluwa Osuntokun 2017-07-04 14:08:08 -07:00
parent a741b4366b
commit 9a30e95d83

View file

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