mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 12:32:48 +01:00
Merge #9446: SetMerkleBranch: remove unused code, remove cs_main lock requirement
9e351c9
SetMerkleBranch: remove unused code, remove cs_main lock requirement (Jonas Schnelli)
This commit is contained in:
parent
a590da317c
commit
7b7ce8997a
@ -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
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user