From 7b7ce8997a1dd2fd7196d97642c0277ad12287e9 Mon Sep 17 00:00:00 2001 From: Jonas Schnelli Date: Tue, 3 Jan 2017 09:31:45 +0100 Subject: [PATCH] Merge #9446: SetMerkleBranch: remove unused code, remove cs_main lock requirement 9e351c9 SetMerkleBranch: remove unused code, remove cs_main lock requirement (Jonas Schnelli) --- src/wallet/wallet.cpp | 10 +--------- src/wallet/wallet.h | 2 +- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index a3afe058a7..ce67943f55 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -5167,21 +5167,13 @@ CWalletKey::CWalletKey(int64_t nExpires) nTimeExpires = nExpires; } -int CMerkleTx::SetMerkleBranch(const CBlockIndex* pindex, int posInBlock) +void CMerkleTx::SetMerkleBranch(const CBlockIndex* pindex, int posInBlock) { - AssertLockHeld(cs_main); - // Update the tx's hashBlock hashBlock = pindex->GetBlockHash(); // set the position of the transaction in the block nIndex = posInBlock; - - // Is the tx in a block that's in the main chain - if (!chainActive.Contains(pindex)) - return 0; - - return chainActive.Height() - pindex->nHeight + 1; } int CMerkleTx::GetDepthInMainChain(const CBlockIndex* &pindexRet, bool enableIX) const diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h index 1b7b26744a..1706feecb6 100644 --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -257,7 +257,7 @@ public: READWRITE(nIndex); } - int SetMerkleBranch(const CBlockIndex* pIndex, int posInBlock); + void SetMerkleBranch(const CBlockIndex* pIndex, int posInBlock); /** * Return depth of transaction in blockchain: