Fix caching of blinding data

This commit is contained in:
Pieter Wuille 2016-03-14 16:15:29 +01:00 committed by Gregory Sanders
parent f2538b9530
commit 09060cfe0d
2 changed files with 11 additions and 0 deletions

View file

@ -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;
}
}
}

View file

@ -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