3

Fully synced node returns null for old transactions when queried using getTransaction or getTransactionReceipt.

Using getTransactionFromBlock(blockNumber, txIndex) however will return the transaction.

Any idea why this happens and how to fix?

1 Answer 1

3

Starting from geth 1.10, node will not index old transactions and unindex existing old ones as new blocks pile on.

That's configured in the --txlookuplimit value option, as explained in docs:

Number of recent blocks to maintain transactions index for (default = about one year, 0 = entire chain) (default: 2350000)

You can change an existing node load parameters and add --txlookuplimit=0, it'll then index all transactions since genesis.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.