Skip to content

Commit

Permalink
btcd: fix error in mempool response inv counting
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenroose committed Nov 25, 2016
1 parent afec1bd commit 95e6de0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -385,14 +385,14 @@ func (sp *serverPeer) OnMemPool(_ *peer.Peer, msg *wire.MsgMemPool) {
txDescs := txMemPool.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,
// or only the transactions that match the filter when there is
// one.
if !sp.filter.IsLoaded() || sp.filter.MatchTxAndUpdate(txDesc.Tx) {
iv := wire.NewInvVect(wire.InvTypeTx, txDesc.Tx.Hash())
invMsg.AddInvVect(iv)
if i+1 >= wire.MaxInvPerMsg {
if len(invMsg.InvList)+1 > wire.MaxInvPerMsg {
break
}
}
Expand Down

0 comments on commit 95e6de0

Please sign in to comment.