diff --git a/core/rawdb/accessors_indexes.go b/core/rawdb/accessors_indexes.go index fb2c3fa307..b59fe354b9 100644 --- a/core/rawdb/accessors_indexes.go +++ b/core/rawdb/accessors_indexes.go @@ -149,7 +149,6 @@ func WriteTxSenderNonceEntryByBlock(db ethdb.KeyValueWriter, block *types.Block, WriteTxSenderNonceEntry(db, sender, tx.Nonce(), tx.Hash()) } } - } // ReadTxSenderNonceIndex retrieves the hash for a specific sender and nonce. diff --git a/eth/api_backend.go b/eth/api_backend.go index 2594cdc925..733fe394a3 100644 --- a/eth/api_backend.go +++ b/eth/api_backend.go @@ -218,7 +218,6 @@ func (b *EthAPIBackend) BlockByNumberOrHash(ctx context.Context, blockNrOrHash r // GetTransactionBySenderAndNonce returns the hash of a transaction for the given sender and nonce. // It checks the pool, then enforces a nonce check against the current state, and finally checks the historical TxSenderNonce index. func (b *EthAPIBackend) GetTransactionBySenderAndNonce(ctx context.Context, sender common.Address, nonce uint64) (*common.Hash, error) { - if pool := b.eth.TxPool(); pool != nil { if tx := pool.GetTxBySenderAndNonce(sender, nonce); tx != nil { hash := tx.Hash() diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index a08f21a2b8..a13e3ee186 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -1450,8 +1450,8 @@ func (api *TransactionAPI) GetTransactionByHash(ctx context.Context, hash common } // GetTransactionBySenderAndNonce returns the hash of a transaction for the given sender and nonce. -func (s *TransactionAPI) GetTransactionBySenderAndNonce(ctx context.Context, sender common.Address, nonce hexutil.Uint64) (*common.Hash, error) { - hash, err := s.b.GetTransactionBySenderAndNonce(ctx, sender, uint64(nonce)) +func (api *TransactionAPI) GetTransactionBySenderAndNonce(ctx context.Context, sender common.Address, nonce hexutil.Uint64) (*common.Hash, error) { + hash, err := api.b.GetTransactionBySenderAndNonce(ctx, sender, uint64(nonce)) if err != nil { return nil, err }