From 4d8750b1ab879bec9024b2d21c7dc21ef84c0a6c Mon Sep 17 00:00:00 2001 From: Duke Leto Date: Tue, 5 Jun 2018 06:29:12 +0000 Subject: [PATCH] Update CWalletTx internals --- src/komodo_validation015.h | 2 +- src/wallet/wallet.h | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/komodo_validation015.h b/src/komodo_validation015.h index b9568ebdf..1b3e9e939 100644 --- a/src/komodo_validation015.h +++ b/src/komodo_validation015.h @@ -81,7 +81,7 @@ void ImportAddress(CWallet*, const CTxDestination& dest, const std::string& strL int32_t gettxout_scriptPubKey(int32_t height,uint8_t *scriptPubKey,int32_t maxsize,uint256 txid,int32_t n) { - static uint256 zero; int32_t i,m; uint8_t *ptr; CTransactionRef tx=0; uint256 hashBlock; + static uint256 zero; int32_t i,m; uint8_t *ptr; CTransactionRef tx = MakeTransactionRef(); uint256 hashBlock; LOCK(cs_main); if ( KOMODO_TXINDEX != 0 ) { diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h index 28c3d649b..b4a0f37ae 100644 --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -288,6 +288,7 @@ private: int GetDepthInMainChainINTERNAL(const CBlockIndex* &pindexRet) const; public: + CTransactionRef tx; uint256 hashBlock; std::vector vMerkleBranch; int nIndex; @@ -298,6 +299,13 @@ public: CMerkleTx() { + SetTx(MakeTransactionRef()); + Init(); + } + + explicit CMerkleTx(CTransactionRef arg) + { + SetTx(std::move(arg)); Init(); } @@ -313,6 +321,11 @@ public: fMerkleVerified = false; } + void SetTx(CTransactionRef arg) + { + tx = std::move(arg); + } + ADD_SERIALIZE_METHODS; template