Browse Source

set capacity of txsmap (#2166)

pull/2177/head
Jun Kimura 6 years ago
committed by Anton Kaliaev
parent
commit
e1b9bf7c81
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      mempool/mempool.go

+ 1
- 1
mempool/mempool.go View File

@ -401,7 +401,7 @@ func (mem *Mempool) collectTxs(maxTxs int) types.Txs {
// NOTE: unsafe; Lock/Unlock must be managed by caller
func (mem *Mempool) Update(height int64, txs types.Txs) error {
// First, create a lookup map of txns in new txs.
txsMap := make(map[string]struct{})
txsMap := make(map[string]struct{}, len(txs))
for _, tx := range txs {
txsMap[string(tx)] = struct{}{}
}


Loading…
Cancel
Save