Changeset View
Changeset View
Standalone View
Standalone View
src/interfaces/chain.cpp
Show First 20 Lines • Show All 88 Lines • ▼ Show 20 Lines | class LockImpl : public Chain::Lock, public UniqueLock<RecursiveMutex> { | ||||
return block->GetBlockHash(); | return block->GetBlockHash(); | ||||
} | } | ||||
int64_t getBlockTime(int height) override { | int64_t getBlockTime(int height) override { | ||||
LockAssertion lock(::cs_main); | LockAssertion lock(::cs_main); | ||||
CBlockIndex *block = ::ChainActive()[height]; | CBlockIndex *block = ::ChainActive()[height]; | ||||
assert(block != nullptr); | assert(block != nullptr); | ||||
return block->GetBlockTime(); | return block->GetBlockTime(); | ||||
} | } | ||||
int64_t getBlockMedianTimePast(int height) override { | |||||
LockAssertion lock(::cs_main); | |||||
CBlockIndex *block = ::ChainActive()[height]; | |||||
assert(block != nullptr); | |||||
return block->GetMedianTimePast(); | |||||
} | |||||
bool haveBlockOnDisk(int height) override { | bool haveBlockOnDisk(int height) override { | ||||
LockAssertion lock(::cs_main); | LockAssertion lock(::cs_main); | ||||
CBlockIndex *block = ::ChainActive()[height]; | CBlockIndex *block = ::ChainActive()[height]; | ||||
return block && (block->nStatus.hasData() != 0) && block->nTx > 0; | return block && (block->nStatus.hasData() != 0) && block->nTx > 0; | ||||
} | } | ||||
Optional<int> | Optional<int> | ||||
findFirstBlockWithTimeAndHeight(int64_t time, int height, | findFirstBlockWithTimeAndHeight(int64_t time, int height, | ||||
BlockHash *hash) override { | BlockHash *hash) override { | ||||
▲ Show 20 Lines • Show All 333 Lines • Show Last 20 Lines |