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.
This commit is contained in:
Daniel Liu 2026-01-05 14:42:28 +08:00 committed by GitHub
parent 3fb8b87a87
commit 1886219894
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -971,7 +971,7 @@ func (pool *TxPool) promoteSpecialTx(addr common.Address, tx *types.Transaction,
// Set the potentially new pending nonce and notify any subsystems of the new tx
pool.beats[addr] = time.Now()
pool.pendingNonces.set(addr, tx.Nonce()+1)
go pool.txFeed.Send(core.NewTxsEvent{Txs: types.Transactions{tx}})
pool.txFeed.Send(core.NewTxsEvent{Txs: []*types.Transaction{tx}})
return true, nil
}