Skip to content

Commit

Permalink
[Trivial] Pass big args by const-reference for notes decryption
Browse files Browse the repository at this point in the history
  • Loading branch information
random-zebra authored and furszy committed Apr 22, 2021
1 parent 7d75415 commit b2d9061
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
5 changes: 2 additions & 3 deletions src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4783,7 +4783,7 @@ void CWalletTx::SetSaplingNoteData(mapSaplingNoteData_t &noteData)

Optional<std::pair<
libzcash::SaplingNotePlaintext,
libzcash::SaplingPaymentAddress>> CWalletTx::DecryptSaplingNote(SaplingOutPoint op) const
libzcash::SaplingPaymentAddress>> CWalletTx::DecryptSaplingNote(const SaplingOutPoint& op) const
{
// Check whether we can decrypt this SaplingOutPoint with the ivk
auto it = this->mapSaplingNoteData.find(op);
Expand Down Expand Up @@ -4811,8 +4811,7 @@ Optional<std::pair<

Optional<std::pair<
libzcash::SaplingNotePlaintext,
libzcash::SaplingPaymentAddress>> CWalletTx::RecoverSaplingNote(
SaplingOutPoint op, std::set<uint256>& ovks) const
libzcash::SaplingPaymentAddress>> CWalletTx::RecoverSaplingNote(const SaplingOutPoint& op, const std::set<uint256>& ovks) const
{
auto output = this->tx->sapData->vShieldedOutput[op.n];

Expand Down
7 changes: 3 additions & 4 deletions src/wallet/wallet.h
Original file line number Diff line number Diff line change
Expand Up @@ -450,16 +450,15 @@ class CWalletTx

void BindWallet(CWallet* pwalletIn);

void SetSaplingNoteData(mapSaplingNoteData_t &noteData);
void SetSaplingNoteData(mapSaplingNoteData_t& noteData);

Optional<std::pair<
libzcash::SaplingNotePlaintext,
libzcash::SaplingPaymentAddress>> DecryptSaplingNote(SaplingOutPoint op) const;
libzcash::SaplingPaymentAddress>> DecryptSaplingNote(const SaplingOutPoint& op) const;

Optional<std::pair<
libzcash::SaplingNotePlaintext,
libzcash::SaplingPaymentAddress>> RecoverSaplingNote(
SaplingOutPoint op, std::set<uint256>& ovks) const;
libzcash::SaplingPaymentAddress>> RecoverSaplingNote(const SaplingOutPoint& op, const std::set<uint256>& ovks) const;

//! checks whether a tx has P2CS inputs or not
bool HasP2CSInputs() const;
Expand Down

0 comments on commit b2d9061

Please sign in to comment.