Remove deletes a transaction from the maintained map, returning whether the transaction was found.
(nonce uint64)
| 170 | // Remove deletes a transaction from the maintained map, returning whether the |
| 171 | // transaction was found. |
| 172 | func (m *txSortedMap) Remove(nonce uint64) bool { |
| 173 | // Short circuit if no transaction is present |
| 174 | _, ok := m.items[nonce] |
| 175 | if !ok { |
| 176 | return false |
| 177 | } |
| 178 | // Otherwise delete the transaction and fix the heap index |
| 179 | for i := 0; i < m.index.Len(); i++ { |
| 180 | if (*m.index)[i] == nonce { |
| 181 | heap.Remove(m.index, i) |
| 182 | break |
| 183 | } |
| 184 | } |
| 185 | delete(m.items, nonce) |
| 186 | m.cache = nil |
| 187 | |
| 188 | return true |
| 189 | } |
| 190 | |
| 191 | // Ready retrieves a sequentially increasing list of transactions starting at the |
| 192 | // provided nonce that is ready for processing. The returned transactions will be |