Changeset View
Changeset View
Standalone View
Standalone View
src/interfaces/chain.cpp
Show First 20 Lines • Show All 276 Lines • ▼ Show 20 Lines | public: | ||||
const FoundBlock &ancestor_out, | const FoundBlock &ancestor_out, | ||||
const FoundBlock &block1_out, | const FoundBlock &block1_out, | ||||
const FoundBlock &block2_out) override { | const FoundBlock &block2_out) override { | ||||
WAIT_LOCK(cs_main, lock); | WAIT_LOCK(cs_main, lock); | ||||
const CBlockIndex *block1 = LookupBlockIndex(block_hash1); | const CBlockIndex *block1 = LookupBlockIndex(block_hash1); | ||||
const CBlockIndex *block2 = LookupBlockIndex(block_hash2); | const CBlockIndex *block2 = LookupBlockIndex(block_hash2); | ||||
const CBlockIndex *ancestor = | const CBlockIndex *ancestor = | ||||
block1 && block2 ? LastCommonAncestor(block1, block2) : nullptr; | block1 && block2 ? LastCommonAncestor(block1, block2) : nullptr; | ||||
// Using & instead of && below to avoid short circuiting and leaving | |||||
// output uninitialized. | |||||
return FillBlock(ancestor, ancestor_out, lock) & | return FillBlock(ancestor, ancestor_out, lock) & | ||||
FillBlock(block1, block1_out, lock) & | FillBlock(block1, block1_out, lock) & | ||||
FillBlock(block2, block2_out, lock); | FillBlock(block2, block2_out, lock); | ||||
} | } | ||||
void findCoins(std::map<COutPoint, Coin> &coins) override { | void findCoins(std::map<COutPoint, Coin> &coins) override { | ||||
return FindCoins(m_node, coins); | return FindCoins(m_node, coins); | ||||
} | } | ||||
double guessVerificationProgress(const BlockHash &block_hash) override { | double guessVerificationProgress(const BlockHash &block_hash) override { | ||||
▲ Show 20 Lines • Show All 159 Lines • Show Last 20 Lines |