Skip to content

Commit 7ba2d57

Browse files
committed
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.
1 parent 90a0aed commit 7ba2d57

File tree

4 files changed

+1
-6
lines changed

4 files changed

+1
-6
lines changed

src/qt/test/wallettests.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,6 @@ void TestGUI()
158158
test.CreateAndProcessBlock({}, GetScriptForRawPubKey(test.coinbaseKey.GetPubKey()));
159159
}
160160
bitdb.MakeMock();
161-
g_wallet_allow_fallback_fee = true;
162-
163161
std::unique_ptr<CWalletDBWrapper> dbw(new CWalletDBWrapper(&bitdb, "wallet_test.dat"));
164162
CWallet wallet(std::move(dbw));
165163
bool firstRun;

src/wallet/test/wallet_test_fixture.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ WalletTestingSetup::WalletTestingSetup(const std::string& chainName):
1111
TestingSetup(chainName)
1212
{
1313
bitdb.MakeMock();
14-
g_wallet_allow_fallback_fee = true;
15-
1614
bool fFirstRun;
1715
g_address_type = OUTPUT_TYPE_DEFAULT;
1816
g_change_type = OUTPUT_TYPE_DEFAULT;

src/wallet/wallet.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ bool bSpendZeroConfChange = DEFAULT_SPEND_ZEROCONF_CHANGE;
4343
bool fWalletRbf = DEFAULT_WALLET_RBF;
4444
OutputType g_address_type = OUTPUT_TYPE_NONE;
4545
OutputType g_change_type = OUTPUT_TYPE_NONE;
46-
bool g_wallet_allow_fallback_fee = false; //<! will be defined via chainparams
46+
bool g_wallet_allow_fallback_fee = true; //<! will be defined via chainparams
4747

4848
const char * DEFAULT_WALLET_DAT = "wallet.dat";
4949
const uint32_t BIP32_HARDENED_KEY_LIMIT = 0x80000000;

src/wallet/wallet.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ static const unsigned int DEFAULT_TX_CONFIRM_TARGET = 6;
6666
static const bool DEFAULT_WALLET_RBF = false;
6767
static const bool DEFAULT_WALLETBROADCAST = true;
6868
static const bool DEFAULT_DISABLE_WALLET = false;
69-
static const bool DEFAULT_WALLET_ALLOW_FALLBACKFEE = true;
7069

7170
extern const char * DEFAULT_WALLET_DAT;
7271

0 commit comments

Comments
 (0)