Skip to content

Commit 5aa6161

Browse files
committed
Merge 5d3b7eb into merged_master (Elements PR #768)
2 parents c587d28 + 5d3b7eb commit 5aa6161

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

src/init.cpp

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1877,10 +1877,17 @@ bool AppInitMain(NodeContext& node)
18771877

18781878
// ELEMENTS:
18791879
uiInterface.InitMessage(_("Awaiting mainchain RPC warmup").translated);
1880-
if (!MainchainRPCCheck(true)) { //Initial check, fail immediately
1881-
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.").translated
1882-
+ "\n\n"
1883-
+ 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").translated);
1880+
if (!MainchainRPCCheck(true)) { //Initial check only
1881+
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";
1882+
// We fail immediately if this node has RPC server enabled
1883+
if (gArgs.GetBoolArg("-server", false)) {
1884+
InitError(err_msg);
1885+
return false;
1886+
} else {
1887+
// Or gently warn the user, and continue
1888+
InitWarning(err_msg);
1889+
gArgs.SoftSetArg("-validatepegin", "0");
1890+
}
18841891
}
18851892

18861893
// Start the lightweight block re-evaluation scheduler thread

0 commit comments

Comments
 (0)