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

Method Put

core/tx_list.go:93–99  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.
93func (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

Callers

nothing calls this directly

Calls 3

NonceMethod · 0.65
NowMethod · 0.65
PushMethod · 0.45

Tested by

no test coverage detected