From 0e7d019e0eb3a4929c504ac5899fbe55c4227f7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Fri, 20 Oct 2017 12:34:43 +0300 Subject: core: fire tx event on replace, expand tests --- core/tx_pool.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'core/tx_pool.go') 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}) } -- cgit v1.2.3