0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-10 10:52:31 -05:00

scripted-diff: rename ZapSelectTx to RemoveTxs

-BEGIN VERIFY SCRIPT-
sed -i 's/ZapSelectTx/RemoveTxs/g' $(git grep -l 'ZapSelectTx' ./src/wallet)
-END VERIFY SCRIPT-
This commit is contained in:
furszy 2024-02-09 11:45:05 -03:00
parent 83b762845f
commit 9a3c5c8697
No known key found for this signature in database
GPG key ID: 5DD23CCC686AA623
4 changed files with 6 additions and 6 deletions

View file

@ -394,7 +394,7 @@ RPCHelpMan removeprunedfunds()
uint256 hash(ParseHashV(request.params[0], "txid")); uint256 hash(ParseHashV(request.params[0], "txid"));
std::vector<uint256> vHash; std::vector<uint256> vHash;
vHash.push_back(hash); 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); throw JSONRPCError(RPC_WALLET_ERROR, util::ErrorString(res).original);
} }

View file

@ -892,7 +892,7 @@ BOOST_FIXTURE_TEST_CASE(CreateWalletWithoutChain, BasicTestingSetup)
UnloadWallet(std::move(wallet)); UnloadWallet(std::move(wallet));
} }
BOOST_FIXTURE_TEST_CASE(ZapSelectTx, TestChain100Setup) BOOST_FIXTURE_TEST_CASE(RemoveTxs, TestChain100Setup)
{ {
m_args.ForceSetArg("-unsafesqlitesync", "1"); m_args.ForceSetArg("-unsafesqlitesync", "1");
WalletContext context; WalletContext context;
@ -919,7 +919,7 @@ BOOST_FIXTURE_TEST_CASE(ZapSelectTx, TestChain100Setup)
BOOST_CHECK_EQUAL(wallet->mapWallet.count(block_hash), 1u); BOOST_CHECK_EQUAL(wallet->mapWallet.count(block_hash), 1u);
std::vector<uint256> vHashIn{ block_hash }; std::vector<uint256> vHashIn{ block_hash };
BOOST_CHECK(wallet->ZapSelectTx(vHashIn)); BOOST_CHECK(wallet->RemoveTxs(vHashIn));
BOOST_CHECK(!wallet->HasWalletSpend(prev_tx)); BOOST_CHECK(!wallet->HasWalletSpend(prev_tx));
BOOST_CHECK_EQUAL(wallet->mapWallet.count(block_hash), 0u); BOOST_CHECK_EQUAL(wallet->mapWallet.count(block_hash), 0u);

View file

@ -2311,7 +2311,7 @@ DBErrors CWallet::LoadWallet()
return nLoadWalletRet; 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); AssertLockHeld(cs_wallet);
WalletBatch batch(GetDatabase()); WalletBatch batch(GetDatabase());
@ -3951,7 +3951,7 @@ bool CWallet::ApplyMigrationData(MigrationData& data, bilingual_str& error)
watchonly_batch.reset(); // Flush watchonly_batch.reset(); // Flush
// Do the removes // Do the removes
if (txids_to_delete.size() > 0) { 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); error = _("Error: Could not delete watchonly transactions. ") + util::ErrorString(res);
return false; return false;
} }

View file

@ -789,7 +789,7 @@ public:
DBErrors LoadWallet(); DBErrors LoadWallet();
/** Erases the provided transactions from the wallet. */ /** 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); bool SetAddressBook(const CTxDestination& address, const std::string& strName, const std::optional<AddressPurpose>& purpose);