MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / GetDepthInMainChain

Method GetDepthInMainChain

src/wallet/wallet.cpp:4395–4408  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4393}
4394
4395int CMerkleTx::GetDepthInMainChain() const
4396{
4397 if (hashUnset())
4398 return 0;
4399
4400 AssertLockHeld(cs_main);
4401
4402 // Find the block it claims to be in
4403 CBlockIndex* pindex = LookupBlockIndex(hashBlock);
4404 if (!pindex || !chainActive.Contains(pindex))
4405 return 0;
4406
4407 return ((nIndex == -1) ? (-1) : 1) * (chainActive.Height() - pindex->nHeight + 1);
4408}
4409
4410int CMerkleTx::GetBlocksToMaturity() const
4411{

Callers 15

WalletTxToJSONFunction · 0.80
getreceivedbyaddressFunction · 0.80
getreceivedbylabelFunction · 0.80
ListReceivedFunction · 0.80
ListTransactionsFunction · 0.80
listaccountsFunction · 0.80
listsinceblockFunction · 0.80
feebumper.cppFile · 0.80
IsSpentMethod · 0.80
AbandonTransactionMethod · 0.80
MarkConflictedMethod · 0.80

Calls 3

LookupBlockIndexFunction · 0.85
HeightMethod · 0.80
ContainsMethod · 0.45

Tested by

no test coverage detected