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

server: fail fast if txindex is not enabled for btc clones #1973

Merged
merged 2 commits into from Nov 29, 2022

Conversation

ukane-philemon
Copy link
Contributor

@ukane-philemon ukane-philemon commented Nov 24, 2022

This ensures txindex is enabled by fetching information for a coinbase transaction of a given block which is essential for dex activities as it could be fatal for btc clone markets if this is not enabled. Closes #1778

Litecoin Core version v0.21.2.1 has getindexinfo rpc command. Tested with bitcoin cash, dogecoin, litecoin and should work for zcash(my zec refuses to sync).
PS: @JoeGruffins, I'd be glad if you can find time to test this with zcash.

@ukane-philemon ukane-philemon marked this pull request as ready for review November 24, 2022 22:51
Copy link
Member

@JoeGruffins JoeGruffins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Working for zcash.

@JoeGruffins
Copy link
Member

Unrelated to these changes, but if you send an rpc request to zcash while it is still doing the initial scan, the request hangs forever.

Copy link
Member

@chappjc chappjc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty reasonable to me. A few little nits.

server/asset/btc/rpcclient.go Outdated Show resolved Hide resolved
server/asset/btc/rpcclient.go Outdated Show resolved Hide resolved
server/asset/btc/rpcclient.go Outdated Show resolved Hide resolved
    - This ensures txindex is enabled by fetching information for a
    coinbase transaction of a given block which is essential for
    dex activities. It is fatal for btc clone markets if this is not
    enabled.
@ukane-philemon
Copy link
Contributor Author

Unrelated to these changes, but if you send an rpc request to zcash while it is still doing the initial scan, the request hangs forever.

Hmm, other btc clones return an error almost immediately. I think using a new ctx with timeout when making requests with an rpcClient should cover such a scenario.

@chappjc chappjc merged commit cf6d205 into decred:master Nov 29, 2022
@chappjc chappjc added this to the 0.6 milestone Dec 27, 2022
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.

server/zec: The getindexinfo rpc endpoint does not exist.
3 participants