| 344 | }; |
| 345 | |
| 346 | bool FillBlock(const CBlockIndex* index, const FoundBlock& block, UniqueLock<RecursiveMutex>& lock, const CChain& active) |
| 347 | { |
| 348 | if (!index) return false; |
| 349 | if (block.m_hash) *block.m_hash = index->GetBlockHash(); |
| 350 | if (block.m_height) *block.m_height = index->nHeight; |
| 351 | if (block.m_time) *block.m_time = index->GetBlockTime(); |
| 352 | if (block.m_max_time) *block.m_max_time = index->GetBlockTimeMax(); |
| 353 | if (block.m_mtp_time) *block.m_mtp_time = index->GetMedianTimePast(); |
| 354 | if (block.m_in_active_chain) *block.m_in_active_chain = active[index->nHeight] == index; |
| 355 | if (block.m_next_block) FillBlock(active[index->nHeight] == index ? active[index->nHeight + 1] : nullptr, *block.m_next_block, lock, active); |
| 356 | if (block.m_data) { |
| 357 | REVERSE_LOCK(lock); |
| 358 | if (!ReadBlockFromDisk(*block.m_data, index, Params().GetConsensus())) block.m_data->SetNull(); |
| 359 | } |
| 360 | block.found = true; |
| 361 | return true; |
| 362 | } |
| 363 | |
| 364 | class NotificationsProxy : public CValidationInterface |
| 365 | { |
no test coverage detected