mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-12-05 03:58:23 +00:00
network: fix tx requests, we can't ask more than 500 txes at once
This commit is contained in:
parent
9756ed2b06
commit
363c24d128
1 changed files with 11 additions and 4 deletions
|
@ -887,11 +887,18 @@ func (s *Server) requestTx(hashes ...util.Uint256) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
msg := s.MkMsg(CMDGetData, payload.NewInventory(payload.TXType, hashes))
|
for i := 0; i < len(hashes)/payload.MaxHashesCount; i++ {
|
||||||
|
start := i * payload.MaxHashesCount
|
||||||
|
stop := (i + 1) * payload.MaxHashesCount
|
||||||
|
if stop < len(hashes) {
|
||||||
|
stop = len(hashes)
|
||||||
|
}
|
||||||
|
msg := s.MkMsg(CMDGetData, payload.NewInventory(payload.TXType, hashes[start:stop]))
|
||||||
// It's high priority because it directly affects consensus process,
|
// It's high priority because it directly affects consensus process,
|
||||||
// even though it's getdata.
|
// even though it's getdata.
|
||||||
s.broadcastHPMessage(msg)
|
s.broadcastHPMessage(msg)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// iteratePeersWithSendMsg sends given message to all peers using two functions
|
// iteratePeersWithSendMsg sends given message to all peers using two functions
|
||||||
// passed, one is to send the message and the other is to filtrate peers (the
|
// passed, one is to send the message and the other is to filtrate peers (the
|
||||||
|
|
Loading…
Reference in a new issue