elements
elements copied to clipboard
validatepegin should try bitcoind's default cookie path
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/.cookieand 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.