Skip to content
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

[Chore] Guard against nil buckets to prevent panics #473

Merged
merged 2 commits into from
May 24, 2021
Merged

Conversation

zquestz
Copy link
Contributor

@zquestz zquestz commented May 21, 2021

Just adds checks to make sure a bucket is returned in our indexers. That way if we have an issue with a nil bucket, it will throw an error and not panic! The buckets should always be present, so returning an error is correct.

Mitigates #472

@zquestz zquestz requested a review from cpacia May 21, 2021 23:56
bchrpc/server.go Outdated Show resolved Hide resolved
@zquestz
Copy link
Contributor Author

zquestz commented May 22, 2021 via email

@jcramer
Copy link
Contributor

jcramer commented May 22, 2021

You call a function that needs the txindex on.

Since s.slpIndex.GraphSearchEnabled() is checked prior to calling s.fetchTransactionFromBlock(txnHash), s.txIndex must be enabled. GS requires txindex.

Even if txIndex is disabled we need this method to run because the call to isSlpValid := s.checkSlpTxOnEvent(txDesc.Tx.MsgTx(), "mempool") allows mempool txns to have slp validity performed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants