| 508 | return FillBlock(active.FindEarliestAtLeast(min_time, min_height), block, lock, active); |
| 509 | } |
| 510 | bool findAncestorByHeight(const uint256& block_hash, int ancestor_height, const FoundBlock& ancestor_out) override |
| 511 | { |
| 512 | WAIT_LOCK(cs_main, lock); |
| 513 | const CChain& active = Assert(m_node.chainman)->ActiveChain(); |
| 514 | if (const CBlockIndex* block = m_node.chainman->m_blockman.LookupBlockIndex(block_hash)) { |
| 515 | if (const CBlockIndex* ancestor = block->GetAncestor(ancestor_height)) { |
| 516 | return FillBlock(ancestor, ancestor_out, lock, active); |
| 517 | } |
| 518 | } |
| 519 | return FillBlock(nullptr, ancestor_out, lock, active); |
| 520 | } |
| 521 | bool findAncestorByHash(const uint256& block_hash, const uint256& ancestor_hash, const FoundBlock& ancestor_out) override |
| 522 | { |
| 523 | WAIT_LOCK(cs_main, lock); |