diff options
author | Russell Yanofsky <russ@yanofsky.org> | 2018-03-02 14:50:49 -0500 |
---|---|---|
committer | Russell Yanofsky <russ@yanofsky.org> | 2018-03-02 14:50:49 -0500 |
commit | 7ba2d5785251c90c5fea134917a4f53a3f632b9a (patch) | |
tree | a3f50ec81e0f8eeb814dc1f588f43c774a480cc5 /src | |
parent | 90a0aed51194ad82da8e011b96f9561c685e40b7 (diff) |
Fix ListCoins test failure due to unset g_wallet_allow_fallback_fee
New global variables were introduced in #11882 and not setting them causes:
wallet/test/wallet_tests.cpp(638): error in "ListCoins": check wallet->CreateTransaction({recipient}, wtx, reservekey, fee, changePos, error, dummy) failed
wallet/test/wallet_tests.cpp(679): error in "ListCoins": check list.begin()->second.size() == 2 failed [1 != 2]
wallet/test/wallet_tests.cpp(686): error in "ListCoins": check available.size() == 2 failed [1 != 2]
wallet/test/wallet_tests.cpp(705): error in "ListCoins": check list.begin()->second.size() == 2 failed [1 != 2]
It's possible to reproduce the failure reliably by running:
src/test/test_bitcoin --log_level=test_suite --run_test=wallet_tests/ListCoins
Failures happen nondeterministically because boost test framework doesn't run
tests in a specified order, and tests that run previously can set the global
variables and mask the bug.
Diffstat (limited to 'src')
-rw-r--r-- | src/qt/test/wallettests.cpp | 2 | ||||
-rw-r--r-- | src/wallet/test/wallet_test_fixture.cpp | 2 | ||||
-rw-r--r-- | src/wallet/wallet.cpp | 2 | ||||
-rw-r--r-- | src/wallet/wallet.h | 1 |
4 files changed, 1 insertions, 6 deletions
diff --git a/src/qt/test/wallettests.cpp b/src/qt/test/wallettests.cpp index 0dc557e3a9..cd49292138 100644 --- a/src/qt/test/wallettests.cpp +++ b/src/qt/test/wallettests.cpp @@ -158,8 +158,6 @@ void TestGUI() test.CreateAndProcessBlock({}, GetScriptForRawPubKey(test.coinbaseKey.GetPubKey())); } bitdb.MakeMock(); - g_wallet_allow_fallback_fee = true; - std::unique_ptr<CWalletDBWrapper> dbw(new CWalletDBWrapper(&bitdb, "wallet_test.dat")); CWallet wallet(std::move(dbw)); bool firstRun; diff --git a/src/wallet/test/wallet_test_fixture.cpp b/src/wallet/test/wallet_test_fixture.cpp index 6ec5ca29ad..18abf9a9db 100644 --- a/src/wallet/test/wallet_test_fixture.cpp +++ b/src/wallet/test/wallet_test_fixture.cpp @@ -11,8 +11,6 @@ WalletTestingSetup::WalletTestingSetup(const std::string& chainName): TestingSetup(chainName) { bitdb.MakeMock(); - g_wallet_allow_fallback_fee = true; - bool fFirstRun; g_address_type = OUTPUT_TYPE_DEFAULT; g_change_type = OUTPUT_TYPE_DEFAULT; diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index af07be311e..bb7be2df33 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -43,7 +43,7 @@ bool bSpendZeroConfChange = DEFAULT_SPEND_ZEROCONF_CHANGE; bool fWalletRbf = DEFAULT_WALLET_RBF; OutputType g_address_type = OUTPUT_TYPE_NONE; OutputType g_change_type = OUTPUT_TYPE_NONE; -bool g_wallet_allow_fallback_fee = false; //<! will be defined via chainparams +bool g_wallet_allow_fallback_fee = true; //<! will be defined via chainparams const char * DEFAULT_WALLET_DAT = "wallet.dat"; const uint32_t BIP32_HARDENED_KEY_LIMIT = 0x80000000; diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h index 8d4b701872..4db45f16ef 100644 --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -66,7 +66,6 @@ static const unsigned int DEFAULT_TX_CONFIRM_TARGET = 6; static const bool DEFAULT_WALLET_RBF = false; static const bool DEFAULT_WALLETBROADCAST = true; static const bool DEFAULT_DISABLE_WALLET = false; -static const bool DEFAULT_WALLET_ALLOW_FALLBACKFEE = true; extern const char * DEFAULT_WALLET_DAT; |