From faa13539d5262bb7a512e9ff82e80083e04315ee Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Mon, 19 Aug 2019 17:38:49 -0400 Subject: [PATCH 1/3] wallet: Fix documentation around WalletParameterInteraction --- src/init.cpp | 2 +- src/wallet/load.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index ca419c05f..0594ec95a 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1106,7 +1106,7 @@ bool AppInitParameterInteraction() if (!ParseMoney(gArgs.GetArg("-minrelaytxfee", ""), n)) { return InitError(AmountErrMsg("minrelaytxfee", gArgs.GetArg("-minrelaytxfee", "")).translated); } - // High fee check is done afterward in WalletParameterInteraction() + // High fee check is done afterward in CWallet::CreateWalletFromFile() ::minRelayTxFee = CFeeRate(n); } else if (incrementalRelayFee > ::minRelayTxFee) { // Allow only setting incrementalRelayFee to control both diff --git a/src/wallet/load.h b/src/wallet/load.h index 81f078fd1..5a62e2930 100644 --- a/src/wallet/load.h +++ b/src/wallet/load.h @@ -17,7 +17,7 @@ class Chain; //! Responsible for reading and validating the -wallet arguments and verifying the wallet database. //! This function will perform salvage on the wallet if requested, as long as only one wallet is -//! being loaded (WalletParameterInteraction forbids -salvagewallet, -zapwallettxes or -upgradewallet with multiwallet). +//! being loaded (WalletInit::ParameterInteraction() forbids -salvagewallet, -zapwallettxes or -upgradewallet with multiwallet). bool VerifyWallets(interfaces::Chain& chain, const std::vector& wallet_files); //! Load wallet databases. From fab3c34412379598b812631e3c123e9467cdc485 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Tue, 20 Aug 2019 12:05:12 -0400 Subject: [PATCH 2/3] test: Print both messages on failure in assert_raises_message --- test/functional/test_framework/util.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/functional/test_framework/util.py b/test/functional/test_framework/util.py index 821e1cd3c..6d74447ad 100644 --- a/test/functional/test_framework/util.py +++ b/test/functional/test_framework/util.py @@ -56,7 +56,9 @@ def assert_raises_message(exc, message, fun, *args, **kwds): raise AssertionError("Use assert_raises_rpc_error() to test RPC failures") except exc as e: if message is not None and message not in e.error['message']: - raise AssertionError("Expected substring not found:" + e.error['message']) + raise AssertionError( + "Expected substring not found in error message:\nsubstring: '{}'\nerror message: '{}'.".format( + message, e.error['message'])) except Exception as e: raise AssertionError("Unexpected exception raised: " + type(e).__name__) else: @@ -116,7 +118,9 @@ def try_rpc(code, message, fun, *args, **kwds): if (code is not None) and (code != e.error["code"]): raise AssertionError("Unexpected JSONRPC error code %i" % e.error["code"]) if (message is not None) and (message not in e.error['message']): - raise AssertionError("Expected substring not found:" + e.error['message']) + raise AssertionError( + "Expected substring not found in error message:\nsubstring: '{}'\nerror message: '{}'.".format( + message, e.error['message'])) return True except Exception as e: raise AssertionError("Unexpected exception raised: " + type(e).__name__) From fa734603b78ba31ebf0da5d2dbe87386eafff01a Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Mon, 19 Aug 2019 17:13:11 -0400 Subject: [PATCH 3/3] wallet: Fix segmentation fault in CreateWalletFromFile --- src/wallet/wallet.cpp | 2 +- .../data/wallets/high_minversion/.walletlock | 0 .../data/wallets/high_minversion/db.log | 0 .../data/wallets/high_minversion/wallet.dat | Bin 0 -> 16384 bytes test/functional/wallet_multiwallet.py | 25 ++++++++++++++++++ 5 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 test/functional/data/wallets/high_minversion/.walletlock create mode 100644 test/functional/data/wallets/high_minversion/db.log create mode 100644 test/functional/data/wallets/high_minversion/wallet.dat diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 84fd01730..e5ec8d84b 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -4243,7 +4243,7 @@ bool CWallet::Verify(interfaces::Chain& chain, const WalletLocation& location, b std::shared_ptr CWallet::CreateWalletFromFile(interfaces::Chain& chain, const WalletLocation& location, uint64_t wallet_creation_flags) { - const std::string& walletFile = WalletDataFilePath(location.GetPath()).string(); + const std::string walletFile = WalletDataFilePath(location.GetPath()).string(); // needed to restore wallet transaction meta data after -zapwallettxes std::vector vWtx; diff --git a/test/functional/data/wallets/high_minversion/.walletlock b/test/functional/data/wallets/high_minversion/.walletlock new file mode 100644 index 000000000..e69de29bb diff --git a/test/functional/data/wallets/high_minversion/db.log b/test/functional/data/wallets/high_minversion/db.log new file mode 100644 index 000000000..e69de29bb diff --git a/test/functional/data/wallets/high_minversion/wallet.dat b/test/functional/data/wallets/high_minversion/wallet.dat new file mode 100644 index 0000000000000000000000000000000000000000..99ab8092631c4a7da2236f46e7250e6c265d3b49 GIT binary patch literal 16384 zcmeI&u}i~16vy#*(Nvobr|srq5Cm}%aT7sManxA^wXso3+Z0;yZ*XvNbaQYl2re#y zgMuJV;w&ysI#h6Q^e#1}N(Z+(d=HL$?Ir2;v;BAx5m9E^5lp+1w#AT{aUs%YKX(k@ z)DOp=OquoMDYw#CO0{>L@5(o8^33)o1p){lfB*srAbE+|5k#500IagfB*srAblYQd{CSHZSTHY z|3B&JC;!Md#b5IO@An3h`&kh{009ILKmY**5I_I{1Q0-=Hv%^Qcjk3Z3a0=6tRMA< ze$x$os&DkAKGX&CJ^%v&1Q0*~0R#|0009ILKmY**x(kepx_@y*rN*M=;gQVR-C1^P z@pb)b;(B#D0iov->tW