Skip to content

Commit b7f6002

Browse files
committed
Fix rescan test failure due to unset g_address_type, g_change_type
New global variables were introduced in #11403 and not setting them causes: test_bitcoin: wallet/wallet.cpp:4259: CTxDestination GetDestinationForKey(const CPubKey&, OutputType): Assertion `false' failed. unknown location(0): fatal error in "importwallet_rescan": signal: SIGABRT (application abort requested) It's possible to reproduce the failure reliably by running: src/test/test_bitcoin --log_level=test_suite --run_test=wallet_tests/importwallet_rescan 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 5dc00f6 commit b7f6002

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/wallet/test/wallet_tests.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,9 @@ BOOST_FIXTURE_TEST_CASE(rescan, TestChain100Setup)
451451
// than or equal to key birthday.
452452
BOOST_FIXTURE_TEST_CASE(importwallet_rescan, TestChain100Setup)
453453
{
454+
g_address_type = OUTPUT_TYPE_DEFAULT;
455+
g_change_type = OUTPUT_TYPE_DEFAULT;
456+
454457
// Create two blocks with same timestamp to verify that importwallet rescan
455458
// will pick up both blocks, not just the first.
456459
const int64_t BLOCK_TIME = chainActive.Tip()->GetBlockTimeMax() + 5;

0 commit comments

Comments
 (0)