MCPcopy Create free account
hub / github.com/CPChain/chain / Remove

Method Remove

core/tx_list.go:172–189  ·  view source on GitHub ↗

Remove deletes a transaction from the maintained map, returning whether the transaction was found.

(nonce uint64)

Source from the content-addressed store, hash-verified

170// Remove deletes a transaction from the maintained map, returning whether the
171// transaction was found.
172func (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

Callers

nothing calls this directly

Calls 2

LenMethod · 0.65
RemoveMethod · 0.45

Tested by

no test coverage detected