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

Method Remove

core/tx_list.go:376–387  ·  view source on GitHub ↗

Remove deletes a transaction from the maintained list, returning whether the transaction was found, and also returning any transaction invalidated due to the deletion (strict mode only).

(tx *types.Transaction)

Source from the content-addressed store, hash-verified

374// transaction was found, and also returning any transaction invalidated due to
375// the deletion (strict mode only).
376func (l *txList) Remove(tx *types.Transaction) (bool, types.Transactions) {
377 // Remove the transaction from the set
378 nonce := tx.Nonce()
379 if removed := l.txs.Remove(nonce); !removed {
380 return false, nil
381 }
382 // In strict mode, filter out non-executable transactions
383 if l.strict {
384 return true, l.txs.Filter(func(tx *types.Transaction) bool { return tx.Nonce() > nonce })
385 }
386 return true, nil
387}
388
389// Ready retrieves a sequentially increasing list of transactions starting at the
390// provided nonce that is ready for processing. The returned transactions will be

Callers 14

RemoveMethod · 0.45
procUnknownAncestorsMethod · 0.45
WriteBlockWithStateMethod · 0.45
writeKeyFileFunction · 0.45
DeleteMethod · 0.45
serveRequestMethod · 0.45
ipcListenFunction · 0.45
forwardMethod · 0.45
RemoveRemoteProposersMethod · 0.45
handleValidateMsgMethod · 0.45

Calls 2

NonceMethod · 0.65
FilterMethod · 0.45

Tested by 2

TestDatadirCreationFunction · 0.36