mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 15:09:59 +01:00
wallet: Rescan mempool for transactions as well
This commit is contained in:
@@ -55,9 +55,6 @@ static const std::shared_ptr<CWallet> TestLoadWallet(WalletContext& context)
|
||||
auto database = MakeWalletDatabase("", options, status, error);
|
||||
auto wallet = CWallet::Create(context, "", std::move(database), options.create_flags, error, warnings);
|
||||
NotifyWalletLoaded(context, wallet);
|
||||
if (context.chain) {
|
||||
wallet->postInitProcess();
|
||||
}
|
||||
return wallet;
|
||||
}
|
||||
|
||||
@@ -765,6 +762,7 @@ BOOST_FIXTURE_TEST_CASE(CreateWallet, TestChain100Setup)
|
||||
// being blocked
|
||||
wallet = TestLoadWallet(context);
|
||||
BOOST_CHECK(rescan_completed);
|
||||
// AddToWallet events for block_tx and mempool_tx
|
||||
BOOST_CHECK_EQUAL(addtx_count, 2);
|
||||
{
|
||||
LOCK(wallet->cs_wallet);
|
||||
@@ -777,6 +775,8 @@ BOOST_FIXTURE_TEST_CASE(CreateWallet, TestChain100Setup)
|
||||
// transactionAddedToMempool events are processed
|
||||
promise.set_value();
|
||||
SyncWithValidationInterfaceQueue();
|
||||
// AddToWallet events for block_tx and mempool_tx events are counted a
|
||||
// second time as the notificaiton queue is processed
|
||||
BOOST_CHECK_EQUAL(addtx_count, 4);
|
||||
|
||||
|
||||
@@ -800,7 +800,7 @@ BOOST_FIXTURE_TEST_CASE(CreateWallet, TestChain100Setup)
|
||||
SyncWithValidationInterfaceQueue();
|
||||
});
|
||||
wallet = TestLoadWallet(context);
|
||||
BOOST_CHECK_EQUAL(addtx_count, 4);
|
||||
BOOST_CHECK_EQUAL(addtx_count, 2);
|
||||
{
|
||||
LOCK(wallet->cs_wallet);
|
||||
BOOST_CHECK_EQUAL(wallet->mapWallet.count(block_tx.GetHash()), 1U);
|
||||
|
||||
Reference in New Issue
Block a user