Skip to content

Commit 1e6b384

Browse files
committed
Merge bitcoin/bitcoin#26702: refactor: walletdb: drop unused FindWalletTx parameter and rename
f496528 walletdb: refactor: drop unused `FindWalletTx` parameter and rename (Sebastian Falbesoner) Pull request description: Since commit 3340dba ("Remove -zapwallettxes"), the `FindWalletTx` helper is only needed to read tx hashes, so drop the other parameter and rename the method accordingly. ACKs for top commit: S3RK: code review ACK f496528 achow101: ACK f496528 vincenzopalazzo: ACK bitcoin/bitcoin@f496528 Tree-SHA512: ead85bc724462f9e920f9d7fe89679931361187579ffd6e63427c8bf5305cd5f71da24ed84f3b1bd22a12be46b5abec13f11822e71a3e1a63bf6cf49de950ab5
2 parents d8bdee0 + f496528 commit 1e6b384

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

src/wallet/walletdb.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -974,7 +974,7 @@ DBErrors WalletBatch::LoadWallet(CWallet* pwallet)
974974
return result;
975975
}
976976

977-
DBErrors WalletBatch::FindWalletTx(std::vector<uint256>& vTxHash, std::list<CWalletTx>& vWtx)
977+
DBErrors WalletBatch::FindWalletTxHashes(std::vector<uint256>& tx_hashes)
978978
{
979979
DBErrors result = DBErrors::LOAD_OK;
980980

@@ -1012,9 +1012,7 @@ DBErrors WalletBatch::FindWalletTx(std::vector<uint256>& vTxHash, std::list<CWal
10121012
if (strType == DBKeys::TX) {
10131013
uint256 hash;
10141014
ssKey >> hash;
1015-
vTxHash.push_back(hash);
1016-
vWtx.emplace_back(/*tx=*/nullptr, TxStateInactive{});
1017-
ssValue >> vWtx.back();
1015+
tx_hashes.push_back(hash);
10181016
}
10191017
}
10201018
} catch (...) {
@@ -1027,10 +1025,9 @@ DBErrors WalletBatch::FindWalletTx(std::vector<uint256>& vTxHash, std::list<CWal
10271025

10281026
DBErrors WalletBatch::ZapSelectTx(std::vector<uint256>& vTxHashIn, std::vector<uint256>& vTxHashOut)
10291027
{
1030-
// build list of wallet TXs and hashes
1028+
// build list of wallet TX hashes
10311029
std::vector<uint256> vTxHash;
1032-
std::list<CWalletTx> vWtx;
1033-
DBErrors err = FindWalletTx(vTxHash, vWtx);
1030+
DBErrors err = FindWalletTxHashes(vTxHash);
10341031
if (err != DBErrors::LOAD_OK) {
10351032
return err;
10361033
}

src/wallet/walletdb.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ class WalletBatch
273273
bool EraseActiveScriptPubKeyMan(uint8_t type, bool internal);
274274

275275
DBErrors LoadWallet(CWallet* pwallet);
276-
DBErrors FindWalletTx(std::vector<uint256>& vTxHash, std::list<CWalletTx>& vWtx);
276+
DBErrors FindWalletTxHashes(std::vector<uint256>& tx_hashes);
277277
DBErrors ZapSelectTx(std::vector<uint256>& vHashIn, std::vector<uint256>& vHashOut);
278278
/* Function to determine if a certain KV/key-type is a key (cryptographical key) type */
279279
static bool IsKeyType(const std::string& strType);

0 commit comments

Comments
 (0)