From 5a601d143196cf9dff7bc4a0beb28dbe890f8713 Mon Sep 17 00:00:00 2001 From: Duke Leto Date: Mon, 8 Jun 2020 11:13:17 -0400 Subject: [PATCH] desprout --- src/wallet/rpcwallet.cpp | 1 + src/wallet/wallet.cpp | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 66ab58f47..873d8eb87 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -38,6 +38,7 @@ #include "zcbenchmarks.h" #include "script/interpreter.h" #include "zcash/zip32.h" +#include "zcash/Note.hpp" #include "notaries_staked.h" #include "utiltime.h" diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index b492ee8a2..a7ca3d74d 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -346,6 +346,14 @@ bool CWallet::LoadSaplingPaymentAddress( return CCryptoKeyStore::AddSaplingIncomingViewingKey(ivk, addr); } +bool CWallet::AddCScript(const CScript& redeemScript) +{ + if (!CCryptoKeyStore::AddCScript(redeemScript)) + return false; + if (!fFileBacked) + return true; + return CWalletDB(strWalletFile).WriteCScript(Hash160(redeemScript), redeemScript); +} bool CWallet::LoadCScript(const CScript& redeemScript) {