Skip to content

Commit

Permalink
scripted-diff: rename ZapSelectTx to RemoveTxs
Browse files Browse the repository at this point in the history
-BEGIN VERIFY SCRIPT-
sed -i 's/ZapSelectTx/RemoveTxs/g' $(git grep -l 'ZapSelectTx' ./src/wallet)
-END VERIFY SCRIPT-
  • Loading branch information
furszy committed Feb 9, 2024
1 parent 83b7628 commit 9a3c5c8
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/wallet/rpc/backup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ RPCHelpMan removeprunedfunds()
uint256 hash(ParseHashV(request.params[0], "txid"));
std::vector<uint256> 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);
}

Expand Down
4 changes: 2 additions & 2 deletions src/wallet/test/wallet_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -919,7 +919,7 @@ BOOST_FIXTURE_TEST_CASE(ZapSelectTx, TestChain100Setup)
BOOST_CHECK_EQUAL(wallet->mapWallet.count(block_hash), 1u);

std::vector<uint256> 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);
Expand Down
4 changes: 2 additions & 2 deletions src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2311,7 +2311,7 @@ DBErrors CWallet::LoadWallet()
return nLoadWalletRet;
}

util::Result<void> CWallet::ZapSelectTx(std::vector<uint256>& txs_to_remove)
util::Result<void> CWallet::RemoveTxs(std::vector<uint256>& txs_to_remove)
{
AssertLockHeld(cs_wallet);
WalletBatch batch(GetDatabase());
Expand Down Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/wallet/wallet.h
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@ class CWallet final : public WalletStorage, public interfaces::Chain::Notificati
DBErrors LoadWallet();

/** Erases the provided transactions from the wallet. */
util::Result<void> ZapSelectTx(std::vector<uint256>& txs_to_remove) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet);
util::Result<void> RemoveTxs(std::vector<uint256>& txs_to_remove) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet);

bool SetAddressBook(const CTxDestination& address, const std::string& strName, const std::optional<AddressPurpose>& purpose);

Expand Down

0 comments on commit 9a3c5c8

Please sign in to comment.