network: fix tx requests, we can't ask more than 500 txes at once
This commit is contained in:
parent
fe1f1d19be
commit
b78bc7f097
1 changed files with 11 additions and 4 deletions
|
@ -795,10 +795,17 @@ func (s *Server) requestTx(hashes ...util.Uint256) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
msg := NewMessage(CMDGetData, payload.NewInventory(payload.TXType, hashes))
|
for i := 0; i < len(hashes)/payload.MaxHashesCount; i++ {
|
||||||
// It's high priority because it directly affects consensus process,
|
start := i * payload.MaxHashesCount
|
||||||
// even though it's getdata.
|
stop := (i + 1) * payload.MaxHashesCount
|
||||||
s.broadcastHPMessage(msg)
|
if stop < len(hashes) {
|
||||||
|
stop = len(hashes)
|
||||||
|
}
|
||||||
|
msg := NewMessage(CMDGetData, payload.NewInventory(payload.TXType, hashes[start:stop]))
|
||||||
|
// It's high priority because it directly affects consensus process,
|
||||||
|
// even though it's getdata.
|
||||||
|
s.broadcastHPMessage(msg)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// iteratePeersWithSendMsg sends given message to all peers using two functions
|
// iteratePeersWithSendMsg sends given message to all peers using two functions
|
||||||
|
|
Loading…
Reference in a new issue