diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index c4a0a40536..76e2d37cff 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -3823,3 +3823,12 @@ void CWallet::ComputeBlindingData(const CTxOut& output, CAmount& amount, CPubKey pubkey = CPubKey(); blindingfactor.SetNull(); } + +void CWalletTx::WipeUnknownBlindingData() const +{ + for (unsigned int n = 0; n < vout.size(); n++) { + if (GetValueOut(n) == -1) { + mapValue["blindingdata"][74 * n] = 0; + } + } +} diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h index 861ded559f..bb779fa457 100644 --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -372,6 +372,7 @@ public: fImmatureWatchCreditCached = false; fDebitCached = false; fChangeCached = false; + WipeUnknownBlindingData(); } void BindWallet(CWallet *pwalletIn) @@ -417,6 +418,7 @@ public: private: void GetBlindingData(unsigned int nOut, CAmount* pamountOut, CPubKey* ppubkeyOut, uint256* pblindingfactorOut) const; + void WipeUnknownBlindingData() const; public: //! Returns either the value out (if it is to us) or 0