aboutsummaryrefslogtreecommitdiffstats
path: root/core/tx_pool.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2017-10-20 20:21:54 +0800
committerGitHub <noreply@github.com>2017-10-20 20:21:54 +0800
commit479aa61f11724560c63a7b56084259552892819d (patch)
treef21465975f55507e85f8a3cebc7440371b266c30 /core/tx_pool.go
parenteaa4f8a5f925592bd777d5b0daf635bec85f6242 (diff)
parent0af1ab0c86975201349d92e0943485c3534d8c8c (diff)
downloaddexon-479aa61f11724560c63a7b56084259552892819d.tar
dexon-479aa61f11724560c63a7b56084259552892819d.tar.gz
dexon-479aa61f11724560c63a7b56084259552892819d.tar.bz2
dexon-479aa61f11724560c63a7b56084259552892819d.tar.lz
dexon-479aa61f11724560c63a7b56084259552892819d.tar.xz
dexon-479aa61f11724560c63a7b56084259552892819d.tar.zst
dexon-479aa61f11724560c63a7b56084259552892819d.zip
Merge pull request #15343 from karalabe/txpool-replacement-propagation
core: fire tx event on replace, expand tests
Diffstat (limited to 'core/tx_pool.go')
-rw-r--r--core/tx_pool.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/core/tx_pool.go b/core/tx_pool.go
index 0ad765179..a705e36d6 100644
--- a/core/tx_pool.go
+++ b/core/tx_pool.go
@@ -640,6 +640,10 @@ func (pool *TxPool) add(tx *types.Transaction, local bool) (bool, error) {
pool.journalTx(from, tx)
log.Trace("Pooled new executable transaction", "hash", hash, "from", from, "to", tx.To())
+
+ // We've directly injected a replacement transaction, notify subsystems
+ go pool.txFeed.Send(TxPreEvent{tx})
+
return old != nil, nil
}
// New transaction isn't replacing a pending one, push into queue
@@ -729,6 +733,7 @@ func (pool *TxPool) promoteTx(addr common.Address, hash common.Hash, tx *types.T
// Set the potentially new pending nonce and notify any subsystems of the new tx
pool.beats[addr] = time.Now()
pool.pendingState.SetNonce(addr, tx.Nonce()+1)
+
go pool.txFeed.Send(TxPreEvent{tx})
}