Browse Source

Fix some compile errors

asyncnotedecryption
Duke 3 months ago
parent
commit
f513004a05
  1. 8
      src/wallet/rpcwallet.cpp
  2. 4
      src/wallet/wallet.cpp
  3. 4
      src/wallet/wallet.h

8
src/wallet/rpcwallet.cpp

@ -3083,7 +3083,7 @@ UniValue getalldata(const UniValue& params, bool fHelp,const CPubKey&)
for (auto addr : zs_addresses) {
libzcash::SaplingExtendedSpendingKey extsk;
if (pwalletMain->GetSaplingExtendedSpendingKey(addr, extsk)) {
auto pt = libzcash::SaplingNotePlaintext::decrypt(
auto pt = libzcash::SaplingNotePlaintext::decrypt( Params().GetConsensus(), chainActive.Height(),
wtx.vShieldedOutput[op.n].encCiphertext,extsk.expsk.full_viewing_key().in_viewing_key(),wtx.vShieldedOutput[op.n].ephemeralKey,wtx.vShieldedOutput[op.n].cm);
if (txType == 0 && pwalletMain->IsLockedNote(op))
@ -4804,7 +4804,7 @@ UniValue z_viewtransaction(const UniValue& params, bool fHelp, const CPubKey& my
}
auto op = res->second;
auto wtxPrev = pwalletMain->mapWallet.at(op.hash);
auto decrypted = wtxPrev.DecryptSaplingNote(op).get();
auto decrypted = wtxPrev.DecryptSaplingNote(Params().GetConsensus(), chainActive.Height(), op).get();
auto notePt = decrypted.first;
auto pa = decrypted.second;
@ -4840,14 +4840,14 @@ UniValue z_viewtransaction(const UniValue& params, bool fHelp, const CPubKey& my
SaplingPaymentAddress pa;
bool isOutgoing;
auto decrypted = wtx.DecryptSaplingNote(op);
auto decrypted = wtx.DecryptSaplingNote(Params().GetConsensus(), chainActive.Height(), op);
if (decrypted) {
notePt = decrypted->first;
pa = decrypted->second;
isOutgoing = false;
} else {
// Try recovering the output
auto recovered = wtx.RecoverSaplingNote(op, ovks);
auto recovered = wtx.RecoverSaplingNote(Params().GetConsensus(), chainActive.Height(), op, ovks);
if (recovered) {
notePt = recovered->first;
pa = recovered->second;

4
src/wallet/wallet.cpp

@ -2319,7 +2319,7 @@ void CWalletTx::SetSaplingNoteData(mapSaplingNoteData_t &noteData)
boost::optional<std::pair<
SaplingNotePlaintext,
SaplingPaymentAddress>> CWalletTx::DecryptSaplingNote(SaplingOutPoint op) const
SaplingPaymentAddress>> CWalletTx::DecryptSaplingNote(const Consensus::Params& params, int height, SaplingOutPoint op) const
{
// Check whether we can decrypt this SaplingOutPoint
if (this->mapSaplingNoteData.count(op) == 0) {
@ -2330,6 +2330,8 @@ boost::optional<std::pair<
auto nd = this->mapSaplingNoteData.at(op);
auto maybe_pt = SaplingNotePlaintext::decrypt(
params,
height,
output.encCiphertext,
nd.ivk,
output.ephemeralKey,

4
src/wallet/wallet.h

@ -575,10 +575,10 @@ public:
boost::optional<std::pair<
libzcash::SaplingNotePlaintext,
libzcash::SaplingPaymentAddress>> DecryptSaplingNote(SaplingOutPoint op) const;
libzcash::SaplingPaymentAddress>> DecryptSaplingNote(const Consensus::Params& params, int height, SaplingOutPoint op) const;
boost::optional<std::pair<
libzcash::SaplingNotePlaintext,
libzcash::SaplingPaymentAddress>> RecoverSaplingNote(
libzcash::SaplingPaymentAddress>> RecoverSaplingNote(const Consensus::Params& params, int height,
SaplingOutPoint op, std::set<uint256>& ovks) const;
//! filter decides which addresses will count towards the debit

Loading…
Cancel
Save