Put inserts a new transaction into the map, also updating the map's nonce index. If a transaction already exists with the same nonce, it's overwritten.
(tx *types.Transaction)
| 91 | // Put inserts a new transaction into the map, also updating the map's nonce |
| 92 | // index. If a transaction already exists with the same nonce, it's overwritten. |
| 93 | func (m *txSortedMap) Put(tx *types.Transaction) { |
| 94 | nonce := tx.Nonce() |
| 95 | if m.items[nonce] == nil { |
| 96 | heap.Push(m.index, nonce) |
| 97 | } |
| 98 | m.items[nonce], m.cache = &TimedTransaction{tx, time.Now()}, nil |
| 99 | } |
| 100 | |
| 101 | // Forward removes all transactions from the map with a nonce lower than the |
| 102 | // provided threshold. Every removed transaction is returned for any post-removal |