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

Method journalTx

core/tx_pool.go:832–840  ·  view source on GitHub ↗

journalTx adds the specified transaction to the local disk journal if it is deemed to have been sent from a local account.

(from common.Address, tx *types.Transaction)

Source from the content-addressed store, hash-verified

830// journalTx adds the specified transaction to the local disk journal if it is
831// deemed to have been sent from a local account.
832func (pool *TxPool) journalTx(from common.Address, tx *types.Transaction) {
833 // Only journal if it's enabled and the transaction is local
834 if pool.journal == nil || !pool.locals.contains(from) {
835 return
836 }
837 if err := pool.journal.insert(tx); err != nil {
838 log.Warn("Failed to journal local transaction", "err", err)
839 }
840}
841
842// promoteTx adds a transaction to the pending (processable) list of transactions
843// and returns whether it was inserted or an older was better.

Callers 1

addMethod · 0.95

Calls 3

containsMethod · 0.80
WarnMethod · 0.65
insertMethod · 0.45

Tested by

no test coverage detected