Increment witnesses for new transactions on rescan

Closes #1400
This commit is contained in:
Jack Grigg
2016-10-13 01:02:13 -05:00
parent fd23341f1e
commit b6961fc112
6 changed files with 60 additions and 16 deletions

View File

@@ -221,9 +221,14 @@ public:
*/
std::list<ZCIncrementalWitness> witnesses;
CNoteData() : address(), nullifier() { }
CNoteData(libzcash::PaymentAddress a) : address {a}, nullifier() { }
CNoteData(libzcash::PaymentAddress a, uint256 n) : address {a}, nullifier {n} { }
/** Block height corresponding to the most current witness. */
int witnessHeight;
CNoteData() : address(), nullifier(), witnessHeight {-1} { }
CNoteData(libzcash::PaymentAddress a) :
address {a}, nullifier(), witnessHeight {-1} { }
CNoteData(libzcash::PaymentAddress a, uint256 n) :
address {a}, nullifier {n}, witnessHeight {-1} { }
ADD_SERIALIZE_METHODS;
@@ -232,6 +237,7 @@ public:
READWRITE(address);
READWRITE(nullifier);
READWRITE(witnesses);
READWRITE(witnessHeight);
}
friend bool operator<(const CNoteData& a, const CNoteData& b) {
@@ -612,7 +618,7 @@ public:
protected:
void IncrementNoteWitnesses(const CBlockIndex* pindex,
const CBlock* pblock,
ZCIncrementalMerkleTree tree);
ZCIncrementalMerkleTree& tree);
void DecrementNoteWitnesses();
template <typename WalletDB>