core/tracing: GetPoolTransactionBySenderAndNonce

Signed-off-by: jsvisa <delweng@gmail.com>
This commit is contained in:
jsvisa 2024-10-03 20:37:51 +08:00
parent acdf44bc14
commit 7c1d2467db
2 changed files with 6 additions and 0 deletions

View file

@ -78,6 +78,7 @@ type Backend interface {
BlockByHash(ctx context.Context, hash common.Hash) (*types.Block, error)
BlockByNumber(ctx context.Context, number rpc.BlockNumber) (*types.Block, error)
GetTransaction(ctx context.Context, txHash common.Hash) (bool, *types.Transaction, common.Hash, uint64, uint64, error)
GetPoolTransactionBySenderAndNonce(sender common.Address, nonce uint64) *types.Transaction
ChainConfig() *params.ChainConfig
}

View file

@ -304,6 +304,11 @@ func (b *EthAPIBackend) GetPoolTransaction(hash common.Hash) *types.Transaction
return b.eth.txPool.Get(hash)
}
// GetPoolTransactionBySenderAndNonce retrieves the pool transaction by the sender and it's nonce
func (b *EthAPIBackend) GetPoolTransactionBySenderAndNonce(sender common.Address, nonce uint64) *types.Transaction {
return b.eth.txPool.GetBySenderAndNonce(sender, nonce)
}
// GetTransaction retrieves the lookup along with the transaction itself associate
// with the given transaction hash.
//