Skip to content

Commit

Permalink
[wallet] Move loopTxsBalance and RecoverSaplingNote to use const refe…
Browse files Browse the repository at this point in the history
…rence inputs/iterators.
  • Loading branch information
furszy committed Apr 24, 2021
1 parent a46b837 commit 50ee79d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2169,7 +2169,7 @@ CWallet::Balance CWallet::GetBalance(const int min_depth) const
return ret;
}

CAmount CWallet::loopTxsBalance(std::function<void(const uint256&, const CWalletTx&, CAmount&)> method) const
CAmount CWallet::loopTxsBalance(const std::function<void(const uint256&, const CWalletTx&, CAmount&)>& method) const
{
CAmount nTotal = 0;
{
Expand Down Expand Up @@ -3903,7 +3903,7 @@ std::vector<CKeyID> CWallet::GetAffectedKeys(const CScript& spk)
std::vector<CKeyID> vAffected;
CAffectedKeysVisitor(*this, vAffected).Process(spk);
for (const CKeyID& keyid : vAffected) {
ret.push_back(keyid);
ret.emplace_back(keyid);
}
return ret;
}
Expand Down Expand Up @@ -4777,7 +4777,7 @@ Optional<std::pair<
{
auto output = this->tx->sapData->vShieldedOutput[op.n];

for (auto ovk : ovks) {
for (const auto& ovk : ovks) {
auto outPt = libzcash::SaplingOutgoingPlaintext::decrypt(
output.outCiphertext,
ovk,
Expand Down
2 changes: 1 addition & 1 deletion src/wallet/wallet.h
Original file line number Diff line number Diff line change
Expand Up @@ -977,7 +977,7 @@ class CWallet : public CCryptoKeyStore, public CValidationInterface
};
Balance GetBalance(int min_depth = 0) const;

CAmount loopTxsBalance(std::function<void(const uint256&, const CWalletTx&, CAmount&)>method) const;
CAmount loopTxsBalance(const std::function<void(const uint256&, const CWalletTx&, CAmount&)>&method) const;
CAmount GetAvailableBalance(bool fIncludeDelegated = true, bool fIncludeShielded = true) const;
CAmount GetAvailableBalance(isminefilter& filter, bool useCache = false, int minDepth = 1) const;
CAmount GetColdStakingBalance() const; // delegated coins for which we have the staking key
Expand Down

0 comments on commit 50ee79d

Please sign in to comment.