From 9a3c5c8697659e34d0476103af942a4615818f4e Mon Sep 17 00:00:00 2001 From: furszy Date: Fri, 9 Feb 2024 11:45:05 -0300 Subject: [PATCH] scripted-diff: rename ZapSelectTx to RemoveTxs -BEGIN VERIFY SCRIPT- sed -i 's/ZapSelectTx/RemoveTxs/g' $(git grep -l 'ZapSelectTx' ./src/wallet) -END VERIFY SCRIPT- --- src/wallet/rpc/backup.cpp | 2 +- src/wallet/test/wallet_tests.cpp | 4 ++-- src/wallet/wallet.cpp | 4 ++-- src/wallet/wallet.h | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/wallet/rpc/backup.cpp b/src/wallet/rpc/backup.cpp index 401c0b2d239..c5340b12064 100644 --- a/src/wallet/rpc/backup.cpp +++ b/src/wallet/rpc/backup.cpp @@ -394,7 +394,7 @@ RPCHelpMan removeprunedfunds() uint256 hash(ParseHashV(request.params[0], "txid")); std::vector vHash; vHash.push_back(hash); - if (auto res = pwallet->ZapSelectTx(vHash); !res) { + if (auto res = pwallet->RemoveTxs(vHash); !res) { throw JSONRPCError(RPC_WALLET_ERROR, util::ErrorString(res).original); } diff --git a/src/wallet/test/wallet_tests.cpp b/src/wallet/test/wallet_tests.cpp index cbab4f2ee98..90195cabad5 100644 --- a/src/wallet/test/wallet_tests.cpp +++ b/src/wallet/test/wallet_tests.cpp @@ -892,7 +892,7 @@ BOOST_FIXTURE_TEST_CASE(CreateWalletWithoutChain, BasicTestingSetup) UnloadWallet(std::move(wallet)); } -BOOST_FIXTURE_TEST_CASE(ZapSelectTx, TestChain100Setup) +BOOST_FIXTURE_TEST_CASE(RemoveTxs, TestChain100Setup) { m_args.ForceSetArg("-unsafesqlitesync", "1"); WalletContext context; @@ -919,7 +919,7 @@ BOOST_FIXTURE_TEST_CASE(ZapSelectTx, TestChain100Setup) BOOST_CHECK_EQUAL(wallet->mapWallet.count(block_hash), 1u); std::vector vHashIn{ block_hash }; - BOOST_CHECK(wallet->ZapSelectTx(vHashIn)); + BOOST_CHECK(wallet->RemoveTxs(vHashIn)); BOOST_CHECK(!wallet->HasWalletSpend(prev_tx)); BOOST_CHECK_EQUAL(wallet->mapWallet.count(block_hash), 0u); diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 3f2b26ef999..4e0fea156c5 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -2311,7 +2311,7 @@ DBErrors CWallet::LoadWallet() return nLoadWalletRet; } -util::Result CWallet::ZapSelectTx(std::vector& txs_to_remove) +util::Result CWallet::RemoveTxs(std::vector& txs_to_remove) { AssertLockHeld(cs_wallet); WalletBatch batch(GetDatabase()); @@ -3951,7 +3951,7 @@ bool CWallet::ApplyMigrationData(MigrationData& data, bilingual_str& error) watchonly_batch.reset(); // Flush // Do the removes if (txids_to_delete.size() > 0) { - if (auto res = ZapSelectTx(txids_to_delete); !res) { + if (auto res = RemoveTxs(txids_to_delete); !res) { error = _("Error: Could not delete watchonly transactions. ") + util::ErrorString(res); return false; } diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h index 5eddaac6d82..397e5265141 100644 --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -789,7 +789,7 @@ class CWallet final : public WalletStorage, public interfaces::Chain::Notificati DBErrors LoadWallet(); /** Erases the provided transactions from the wallet. */ - util::Result ZapSelectTx(std::vector& txs_to_remove) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); + util::Result RemoveTxs(std::vector& txs_to_remove) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); bool SetAddressBook(const CTxDestination& address, const std::string& strName, const std::optional& purpose);