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

validatepegin should try bitcoind's default cookie path #1120

Closed
3 tasks
wtogami opened this issue Jun 29, 2022 · 0 comments · Fixed by #1173
Closed
3 tasks

validatepegin should try bitcoind's default cookie path #1120

wtogami opened this issue Jun 29, 2022 · 0 comments · Fixed by #1173

Comments

@wtogami
Copy link
Contributor

wtogami commented Jun 29, 2022

Elements BTC peg needs to query a bitcoind full node via RPC to verify that all pegged BTC on the sidechain is fully backed. validatepegin=0 turns off this requirement but we should not encourage this unsafe practice. It would simplify deployment for those running bitcoind and elementsd as the same user if elementsd looks for the default cookie path to connect to the local bitcoind.

Fix

If validatepegin=1 ...

  • If any of the mainchainrpc* options are defined then use that. If it fails print an error and exit.
  • NEW: Otherwise look at the default path $HOME/.bitcoin/.cookie and try if that exists.
  • NEW: During runtime if the underlying bitcoind restarts the cookie changes. Elementsd should recognize this change and switch to the new cookie contents during runtime.
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 a pull request may close this issue.

1 participant