| 4393 | } |
| 4394 | |
| 4395 | int 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 | |
| 4410 | int CMerkleTx::GetBlocksToMaturity() const |
| 4411 | { |
no test coverage detected