From 5d4965198d75d6758b06331175a58e4a9f43d286 Mon Sep 17 00:00:00 2001 From: Cave Spectre Date: Mon, 23 Nov 2020 02:15:38 +0000 Subject: [PATCH] [Config] Ignore prune mode if txindex is set --- src/init.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index e7807d563e..f39befe0b4 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1,7 +1,7 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2019 The Bitcoin Core developers // Copyright (c) 2015-2019 The PIVX developers -// Copyright (c) 2018-2019 The Veil developers +// Copyright (c) 2018-2020 The Veil developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -1000,7 +1000,7 @@ bool AppInitParameterInteraction() // if using block pruning, then disallow txindex if (gArgs.GetArg("-prune", 0)) { if (gArgs.GetBoolArg("-txindex", DEFAULT_TXINDEX)) - return InitError(_("Prune mode is incompatible with -txindex.")); + InitWarning(_("Ignoring Prune Mode: Incompatible with -txindex.")); } // -bind and -whitebind can't be set when not listening @@ -1123,6 +1123,10 @@ bool AppInitParameterInteraction() if (nPruneArg < 0) { return InitError(_("Prune cannot be configured with a negative value.")); } + if (nPruneArg && gArgs.GetBoolArg("-txindex", DEFAULT_TXINDEX)) { + // We already warned them that it's getting ignored + nPruneArg = 0; + } nPruneTarget = (uint64_t) nPruneArg * 1024 * 1024; if (nPruneArg == 1) { // manual pruning: -prune=1 LogPrintf("Block pruning enabled. Use RPC call pruneblockchain(height) to manually prune block and undo files.\n");