mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 12:32:48 +01:00
fixed depth function
This commit is contained in:
parent
12e66dbdcb
commit
f21b1cdcd3
@ -1216,22 +1216,22 @@ int CMerkleTx::GetDepthInMainChain(CBlockIndex* &pindexRet) const
|
||||
minConfirms = IsTransactionLocked();
|
||||
|
||||
if (hashBlock == 0 || nIndex == -1)
|
||||
return 0;
|
||||
return minConfirms;
|
||||
|
||||
// Find the block it claims to be in
|
||||
map<uint256, CBlockIndex*>::iterator mi = mapBlockIndex.find(hashBlock);
|
||||
if (mi == mapBlockIndex.end())
|
||||
return 0;
|
||||
return minConfirms;
|
||||
|
||||
CBlockIndex* pindex = (*mi).second;
|
||||
if (!pindex || !pindex->IsInMainChain())
|
||||
return 0;
|
||||
return minConfirms;
|
||||
|
||||
// Make sure the merkle branch connects to this block
|
||||
if (!fMerkleVerified)
|
||||
{
|
||||
if (CBlock::CheckMerkleBranch(GetHash(), vMerkleBranch, nIndex) != pindex->hashMerkleRoot)
|
||||
return 0;
|
||||
return minConfirms;
|
||||
fMerkleVerified = true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user