-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG and possible FIX]: Indexer: txindex.go panics #472
Comments
A txindex is required for this functionality. Those methods should just error if a txindex is not present. |
Can you provide an example |
The I have observed that this panic occurs in the following three situations:
Config file flags.
|
Resyncing and #473 fixed it. I am closing the issue. |
Details:
bchd version 0.18.0
macOS version 11.3.1
go version go1.16.3 darwin/amd64
Error:
Situation:
This occurs on at least 2 calls.
GetTransactionRequest
andSubscribeTransactionsRequest
stream.After diving into the codebase I got to know that
txIndex
is nil sometimes and that leads to a panic when getting the serialisedDataserializedData := txIndex.Get(txHash[:])
https://github.com/gcash/bchd/blob/master/blockchain/indexers/txindex.go#L191Solution?
Add a check for it.
After adding the check, I am able to stream and fetch the transactions.
Note: I am still not very comfortable with the codebase and doing this fix might break something elsewhere.
The text was updated successfully, but these errors were encountered: