Transaction is nil (#3273)

* checks if txn is nil

* returning nil, nil
This commit is contained in:
Enrique Jose Avila Asapche 2022-01-18 17:04:05 +03:00 committed by GitHub
parent f141803661
commit ef180848f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -81,6 +81,12 @@ func (api *APIImpl) GetTransactionByHash(ctx context.Context, hash common.Hash)
if err != nil {
return nil, err
}
// if no transactiion was found in the txpool then we return nil and an error warning that we didn't find the transaction by the hash
if txn == nil {
return nil, nil
}
return newRPCPendingTransaction(txn, curHeader, chainConfig), nil
}