mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-28 15:46:43 +00:00
Fix bor tx missing
This commit is contained in:
parent
48bdfa7ffb
commit
3b9f73ab69
1 changed files with 3 additions and 10 deletions
|
|
@ -2006,19 +2006,12 @@ func (api *TransactionAPI) GetTransactionByHash(ctx context.Context, hash common
|
||||||
|
|
||||||
// Try to return an already finalized transaction
|
// Try to return an already finalized transaction
|
||||||
found, tx, blockHash, blockNumber, index, err := api.b.GetTransaction(ctx, hash)
|
found, tx, blockHash, blockNumber, index, err := api.b.GetTransaction(ctx, hash)
|
||||||
if !found {
|
if err != nil {
|
||||||
// No finalized transaction, try to retrieve it from the pool
|
return nil, err
|
||||||
if tx := api.b.GetPoolTransaction(hash); tx != nil {
|
|
||||||
return NewRPCPendingTransaction(tx, api.b.CurrentHeader(), api.b.ChainConfig()), nil
|
|
||||||
}
|
|
||||||
if err == nil {
|
|
||||||
return nil, nil
|
|
||||||
}
|
|
||||||
return nil, NewTxIndexingError()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// fetch bor block tx if necessary
|
// fetch bor block tx if necessary
|
||||||
if tx == nil {
|
if !found {
|
||||||
if tx, blockHash, blockNumber, index, err = api.b.GetBorBlockTransaction(ctx, hash); err != nil {
|
if tx, blockHash, blockNumber, index, err = api.b.GetBorBlockTransaction(ctx, hash); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue