mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01:00
Merge bitcoin/bitcoin#25351: rpc, wallet: Scan mempool after import* - Second attempt
1be7964189test, wallet: Add mempool rescan test for import RPCs (Fabian Jahr)833ce76df7rpc, wallet: Document mempool rescan after importdescriptor, importwallet (Fabian Jahr)0e396d1ba7rpc, wallet: Document mempool scan after importmulti (Fabian Jahr)e6d3ef8586rpc, wallet: Document mempool scan after importpubkey (Fabian Jahr)6d3db52e66rpc, wallet: Document and test mempool scan after importprivkey (João Barbosa)3abdbbb90arpc, wallet: Document and test mempool scan after importaddress (João Barbosa)236239bd40wallet: Rescan mempool for transactions as well (Fabian Jahr) Pull request description: This PR picks up the work from #18964 and closes #18954. It should incorporate all the unaddressed feedback from the PR: - Mempool rescan now expanded to all relevant import* RPCs - Added documentation in the help of each RPC - More tests ACKs for top commit: Sjors: re-utACK1be7964189(only a test change) achow101: ACK1be7964189w0xlt: reACK1be7964189Tree-SHA512: b62fed5f97c6c242b2af417b41c9696a1f18878483d9e1c9429791f9c05257f57a00540a9a84df23c49faf6a61c3109c22972de81540083f38b506217804fcc5
This commit is contained in:
@@ -53,9 +53,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;
|
||||
}
|
||||
|
||||
@@ -768,6 +765,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);
|
||||
@@ -780,6 +778,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);
|
||||
|
||||
|
||||
@@ -803,7 +803,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