aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2019-05-16 11:18:17 -0400
committerMarcoFalke <falke.marco@gmail.com>2019-05-16 11:18:27 -0400
commitd5931f3676ecc6f5134ed9cd92b490b48ee44e57 (patch)
tree13ac8e8d7ff32ff4ad583bfa85ed4ef1235ed4c7 /src/interfaces
parent41f4c63b389813b587ec58d8cd6c3bbc46fe8887 (diff)
parentfa7e311e169349bfcf1dab8b980724e8ddf4e749 (diff)
downloadbitcoin-d5931f3676ecc6f5134ed9cd92b490b48ee44e57.tar.xz
Merge #15870: wallet: Only fail rescan when blocks have actually been pruned
fa7e311e16 [doc] rpcwallet: Only fail rescan when blocks have been pruned (MarcoFalke) aaaa57c2aa scripted-diff: Bump copyright headers in wallet (MarcoFalke) faf3729242 wallet: Only fail rescan when blocks have actually been pruned (MarcoFalke) Pull request description: This brings the behaviour of the import* calls closer to importmulti. After this change, the difference between importmulti and the other import* calls is * that in importmulti you can "opt-out" of scanning early blocks by setting a later timestamp. * that in importmulti the wallet will successfully import the data, but fail to rescan. Whereas in the other calls, the wallet will abort before importing the data. ACKs for commit fa7e31: promag: utACK fa7e311e169349bfcf1dab8b980724e8ddf4e749. jnewbery: utACK fa7e311e169349bfcf1dab8b980724e8ddf4e749 Tree-SHA512: a57d52ffea94b64e0eb9b5d3a7a63031325833908297dd14eb0c5251ffea3b2113b131003f1db4e9599e014369165a57f107a7150bb65e4c791e5fe742f33cb8
Diffstat (limited to 'src/interfaces')
-rw-r--r--src/interfaces/chain.cpp8
-rw-r--r--src/interfaces/chain.h6
2 files changed, 9 insertions, 5 deletions
diff --git a/src/interfaces/chain.cpp b/src/interfaces/chain.cpp
index 59623284d2..d2a915ec02 100644
--- a/src/interfaces/chain.cpp
+++ b/src/interfaces/chain.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2018 The Bitcoin Core developers
+// Copyright (c) 2018-2019 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
@@ -332,7 +332,11 @@ public:
CFeeRate relayMinFee() override { return ::minRelayTxFee; }
CFeeRate relayIncrementalFee() override { return ::incrementalRelayFee; }
CFeeRate relayDustFee() override { return ::dustRelayFee; }
- bool getPruneMode() override { return ::fPruneMode; }
+ bool havePruned() override
+ {
+ LOCK(cs_main);
+ return ::fHavePruned;
+ }
bool p2pEnabled() override { return g_connman != nullptr; }
bool isReadyToBroadcast() override { return !::fImporting && !::fReindex && !IsInitialBlockDownload(); }
bool isInitialBlockDownload() override { return IsInitialBlockDownload(); }
diff --git a/src/interfaces/chain.h b/src/interfaces/chain.h
index 0b7249a5ab..1d604bd823 100644
--- a/src/interfaces/chain.h
+++ b/src/interfaces/chain.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2018 The Bitcoin Core developers
+// Copyright (c) 2018-2019 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
@@ -196,8 +196,8 @@ public:
//! Relay dust fee setting (-dustrelayfee), reflecting lowest rate it's economical to spend.
virtual CFeeRate relayDustFee() = 0;
- //! Check if pruning is enabled.
- virtual bool getPruneMode() = 0;
+ //! Check if any block has been pruned.
+ virtual bool havePruned() = 0;
//! Check if p2p enabled.
virtual bool p2pEnabled() = 0;