Merge #768: When RPC server disabled, only warn on validatepegin failure

674f3c747 When RPC server disabled, only warn on validatepegin failure (Gregory Sanders)

Pull request description:

  QT starts up normally, and fails when `-server=1` is set, and continues otherwise, by turning off peg-in validation.

  This should be tested on liquidv1 with fresh syncs.

Tree-SHA512: acf188b2eead8db2f2b8d92ae90b510a05e6ab15639249917a3fb99bf3ec48b3d741e372a4bfcf44b8c632d199e56070bbfe1f6a69ef1c991f126b4d34b218a8
This commit is contained in:
Steven Roose 2019-11-05 16:35:30 +00:00
commit 5d3b7eb9f8
No known key found for this signature in database
GPG key ID: 2F2A88D7F8D68E87

View file

@ -1883,10 +1883,17 @@ bool AppInitMain(InitInterfaces& interfaces)
// ELEMENTS:
uiInterface.InitMessage(_("Awaiting mainchain RPC warmup"));
if (!MainchainRPCCheck(true)) { //Initial check, fail immediately
return InitError(_("ERROR: elementsd is set to verify pegins but cannot get valid response from the mainchain daemon. Please check debug.log for more information.")
+ "\n\n"
+ strprintf(_("If you haven't setup a %s please get the latest stable version from %s or if you do not need to validate pegins set in your elements configuration %s"), "bitcoind", "https://bitcoincore.org/en/download/", "validatepegin=0"));
if (!MainchainRPCCheck(true)) { //Initial check only
const std::string err_msg = "ERROR: elements is set to verify pegins but cannot get valid response from the mainchain daemon. Please check debug.log for more information.\n\nIf you haven't setup a bitcoind please get the latest stable version from https://bitcoincore.org/en/download/ or if you do not need to validate pegins set in your elements configuration validatepegin=0";
// We fail immediately if this node has RPC server enabled
if (gArgs.GetBoolArg("-server", false)) {
InitError(err_msg);
return false;
} else {
// Or gently warn the user, and continue
InitWarning(err_msg);
gArgs.SoftSetArg("-validatepegin", "0");
}
}
// Start the lightweight block re-evaluation scheduler thread