Changeset View
Changeset View
Standalone View
Standalone View
src/interfaces/chain.cpp
Show First 20 Lines • Show All 283 Lines • ▼ Show 20 Lines | public: | ||||
std::unique_ptr<Chain::Lock> result = std::move(lock); | std::unique_ptr<Chain::Lock> result = std::move(lock); | ||||
return result; | return result; | ||||
} | } | ||||
bool findBlock(const BlockHash &hash, | bool findBlock(const BlockHash &hash, | ||||
const FoundBlock &block) override { | const FoundBlock &block) override { | ||||
WAIT_LOCK(cs_main, lock); | WAIT_LOCK(cs_main, lock); | ||||
return FillBlock(LookupBlockIndex(hash), block, lock); | return FillBlock(LookupBlockIndex(hash), block, lock); | ||||
} | } | ||||
bool findAncestorByHash(const BlockHash &block_hash, | |||||
const BlockHash &ancestor_hash, | |||||
const FoundBlock &ancestor_out) override { | |||||
WAIT_LOCK(cs_main, lock); | |||||
const CBlockIndex *block = LookupBlockIndex(block_hash); | |||||
const CBlockIndex *ancestor = LookupBlockIndex(ancestor_hash); | |||||
if (block && ancestor && | |||||
block->GetAncestor(ancestor->nHeight) != ancestor) { | |||||
ancestor = nullptr; | |||||
} | |||||
return FillBlock(ancestor, ancestor_out, lock); | |||||
} | |||||
void findCoins(std::map<COutPoint, Coin> &coins) override { | void findCoins(std::map<COutPoint, Coin> &coins) override { | ||||
return FindCoins(coins); | return FindCoins(coins); | ||||
} | } | ||||
double guessVerificationProgress(const BlockHash &block_hash) override { | double guessVerificationProgress(const BlockHash &block_hash) override { | ||||
LOCK(cs_main); | LOCK(cs_main); | ||||
return GuessVerificationProgress(Params().TxData(), | return GuessVerificationProgress(Params().TxData(), | ||||
LookupBlockIndex(block_hash)); | LookupBlockIndex(block_hash)); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 132 Lines • Show Last 20 Lines |