From 8ac81133c3e0588a561a6d1eb2e0be52163a15d0 Mon Sep 17 00:00:00 2001 From: miketout Date: Wed, 6 May 2020 22:11:10 -0700 Subject: [PATCH] Equals operators for copying --- src/primitives/block.h | 8 ++++++++ src/primitives/transaction.h | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/src/primitives/block.h b/src/primitives/block.h index 74a5a5b30..349c30cac 100644 --- a/src/primitives/block.h +++ b/src/primitives/block.h @@ -549,6 +549,14 @@ public: CBlockHeaderProof(const CMMRProof &powerNodeProof, const CBlockHeader &bh) : headerProof(powerNodeProof), mmrBridge(bh.MMRProofBridge()), preHeader(bh) {} + const CBlockHeaderProof &operator=(const CBlockHeaderProof &operand) + { + CDataStream s(SER_NETWORK, PROTOCOL_VERSION); + s << operand; + s >> *this; + return *this; + } + ADD_SERIALIZE_METHODS; template diff --git a/src/primitives/transaction.h b/src/primitives/transaction.h index 927800088..e58c4af30 100644 --- a/src/primitives/transaction.h +++ b/src/primitives/transaction.h @@ -1235,6 +1235,14 @@ public: CPartialTransactionProof(const CMMRProof &txRootProof, const CTransaction &tx) : txProof(txRootProof), components({CTransactionComponentProof(tx, 0, CMMRProof())}) { } + const CPartialTransactionProof &operator=(const CPartialTransactionProof &operand) + { + CDataStream s(SER_NETWORK, PROTOCOL_VERSION); + s << operand; + s >> *this; + return *this; + } + ADD_SERIALIZE_METHODS; template -- 2.42.0