Skip to content

Commit 1886219

Browse files
authored
core/txpool: use right type for field Txs in NewTxsEvent (#1897)
This commit updates the Txs field in NewTxsEvent to use []*types.Transaction instead of types.Transactions. This ensures type consistency for event broadcasting and handling, improving reliability of transaction propagation across the network. The change also removes unnecessary goroutine usage for txFeed.Send, making event delivery synchronous and safer for downstream consumers.
1 parent 3fb8b87 commit 1886219

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/txpool/txpool.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -971,7 +971,7 @@ func (pool *TxPool) promoteSpecialTx(addr common.Address, tx *types.Transaction,
971971
// Set the potentially new pending nonce and notify any subsystems of the new tx
972972
pool.beats[addr] = time.Now()
973973
pool.pendingNonces.set(addr, tx.Nonce()+1)
974-
go pool.txFeed.Send(core.NewTxsEvent{Txs: types.Transactions{tx}})
974+
pool.txFeed.Send(core.NewTxsEvent{Txs: []*types.Transaction{tx}})
975975
return true, nil
976976
}
977977

0 commit comments

Comments
 (0)