| 157 | } |
| 158 | |
| 159 | static int ComputeNextBlockAndDepth(const CBlockIndex* tip, const CBlockIndex* blockindex, const CBlockIndex*& next) |
| 160 | { |
| 161 | next = tip->GetAncestor(blockindex->nHeight + 1); |
| 162 | if (next && next->pprev == blockindex) { |
| 163 | return tip->nHeight - blockindex->nHeight + 1; |
| 164 | } |
| 165 | next = nullptr; |
| 166 | return blockindex == tip ? 1 : -1; |
| 167 | } |
| 168 | |
| 169 | CBlockIndex* ParseHashOrHeight(const UniValue& param, ChainstateManager& chainman) { |
| 170 | LOCK(::cs_main); |
no test coverage detected