btcd: fix error in mempool response inv counting
This commit is contained in:
parent
afec1bd124
commit
95e6de00b8
1 changed files with 2 additions and 2 deletions
|
@ -385,14 +385,14 @@ func (sp *serverPeer) OnMemPool(_ *peer.Peer, msg *wire.MsgMemPool) {
|
||||||
txDescs := txMemPool.TxDescs()
|
txDescs := txMemPool.TxDescs()
|
||||||
invMsg := wire.NewMsgInvSizeHint(uint(len(txDescs)))
|
invMsg := wire.NewMsgInvSizeHint(uint(len(txDescs)))
|
||||||
|
|
||||||
for i, txDesc := range txDescs {
|
for _, txDesc := range txDescs {
|
||||||
// Either add all transactions when there is no bloom filter,
|
// Either add all transactions when there is no bloom filter,
|
||||||
// or only the transactions that match the filter when there is
|
// or only the transactions that match the filter when there is
|
||||||
// one.
|
// one.
|
||||||
if !sp.filter.IsLoaded() || sp.filter.MatchTxAndUpdate(txDesc.Tx) {
|
if !sp.filter.IsLoaded() || sp.filter.MatchTxAndUpdate(txDesc.Tx) {
|
||||||
iv := wire.NewInvVect(wire.InvTypeTx, txDesc.Tx.Hash())
|
iv := wire.NewInvVect(wire.InvTypeTx, txDesc.Tx.Hash())
|
||||||
invMsg.AddInvVect(iv)
|
invMsg.AddInvVect(iv)
|
||||||
if i+1 >= wire.MaxInvPerMsg {
|
if len(invMsg.InvList)+1 > wire.MaxInvPerMsg {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue