Skip to content

Commit 2362c00

Browse files
committed
When RPC server disabled, only warn on validatepegin failure
1 parent c53a313 commit 2362c00

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
@@ -1876,10 +1876,17 @@ bool AppInitMain(InitInterfaces& interfaces)
18761876

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

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

0 commit comments

Comments
 (0)