From a132719da59e13574c96f9335dd79fbbc63f77ce Mon Sep 17 00:00:00 2001 From: Simon Date: Sat, 28 Jul 2018 00:04:09 -0700 Subject: [PATCH] Add ivk member variable and equality comparators to SaplingNoteData class. --- src/wallet/wallet.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h index e01a724b7..0a1be0387 100644 --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -267,13 +267,23 @@ class SaplingNoteData { public: /** - * We initialize the hight to -1 for the same reason as we do in SproutNoteData. + * We initialize the height to -1 for the same reason as we do in SproutNoteData. * See the comment in that class for a full description. */ SaplingNoteData() : witnessHeight {-1} { } + SaplingNoteData(libzcash::SaplingIncomingViewingKey ivk) : ivk {ivk}, witnessHeight {-1} { } std::list witnesses; int witnessHeight; + libzcash::SaplingIncomingViewingKey ivk; + + friend bool operator==(const SaplingNoteData& a, const SaplingNoteData& b) { + return (a.ivk == b.ivk && a.nullifier == b.nullifier && a.witnessHeight == b.witnessHeight); + } + + friend bool operator!=(const SaplingNoteData& a, const SaplingNoteData& b) { + return !(a == b); + } }; typedef std::map mapSproutNoteData_t;