mirror of
https://github.com/LBRYFoundation/lbcd.git
synced 2025-08-23 17:47:24 +00:00
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
12
peer/peer.go
12
peer/peer.go
|
@ -1723,8 +1723,20 @@ out:
|
||||||
case iv := <-p.outputInvChan:
|
case iv := <-p.outputInvChan:
|
||||||
// No handshake? They'll find out soon enough.
|
// No handshake? They'll find out soon enough.
|
||||||
if p.VersionKnown() {
|
if p.VersionKnown() {
|
||||||
|
// 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)
|
invSendQueue.PushBack(iv)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
case <-trickleTicker.C:
|
case <-trickleTicker.C:
|
||||||
// Don't send anything if we're disconnecting or there
|
// Don't send anything if we're disconnecting or there
|
||||||
|
|
Loading…
Add table
Reference in a new issue