network: reuse inventory hash list for request hashes
Microoptimization, we can do this because we only use them in handleInvCmd().
This commit is contained in:
parent
0f625f04f0
commit
e003b67418
1 changed files with 1 additions and 1 deletions
|
@ -751,7 +751,7 @@ func (s *Server) handlePong(p Peer, pong *payload.Ping) error {
|
||||||
|
|
||||||
// handleInvCmd processes the received inventory.
|
// handleInvCmd processes the received inventory.
|
||||||
func (s *Server) handleInvCmd(p Peer, inv *payload.Inventory) error {
|
func (s *Server) handleInvCmd(p Peer, inv *payload.Inventory) error {
|
||||||
reqHashes := make([]util.Uint256, 0)
|
var reqHashes = inv.Hashes[:0]
|
||||||
var typExists = map[payload.InventoryType]func(util.Uint256) bool{
|
var typExists = map[payload.InventoryType]func(util.Uint256) bool{
|
||||||
payload.TXType: s.mempool.ContainsKey,
|
payload.TXType: s.mempool.ContainsKey,
|
||||||
payload.BlockType: s.chain.HasBlock,
|
payload.BlockType: s.chain.HasBlock,
|
||||||
|
|
Loading…
Reference in a new issue