Skip to content

Commit 510c0d9

Browse files
committed
Merge #9446: SetMerkleBranch: remove unused code, remove cs_main lock requirement
9e351c9 SetMerkleBranch: remove unused code, remove cs_main lock requirement (Jonas Schnelli)
2 parents 53442af + 9e351c9 commit 510c0d9

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

src/wallet/wallet.cpp

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3736,21 +3736,13 @@ CWalletKey::CWalletKey(int64_t nExpires)
37363736
nTimeExpires = nExpires;
37373737
}
37383738

3739-
int CMerkleTx::SetMerkleBranch(const CBlockIndex* pindex, int posInBlock)
3739+
void CMerkleTx::SetMerkleBranch(const CBlockIndex* pindex, int posInBlock)
37403740
{
3741-
AssertLockHeld(cs_main);
3742-
37433741
// Update the tx's hashBlock
37443742
hashBlock = pindex->GetBlockHash();
37453743

37463744
// set the position of the transaction in the block
37473745
nIndex = posInBlock;
3748-
3749-
// Is the tx in a block that's in the main chain
3750-
if (!chainActive.Contains(pindex))
3751-
return 0;
3752-
3753-
return chainActive.Height() - pindex->nHeight + 1;
37543746
}
37553747

37563748
int CMerkleTx::GetDepthInMainChain(const CBlockIndex* &pindexRet) const

src/wallet/wallet.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ class CMerkleTx
218218
READWRITE(nIndex);
219219
}
220220

221-
int SetMerkleBranch(const CBlockIndex* pIndex, int posInBlock);
221+
void SetMerkleBranch(const CBlockIndex* pIndex, int posInBlock);
222222

223223
/**
224224
* Return depth of transaction in blockchain:

0 commit comments

Comments
 (0)