Changeset View
Changeset View
Standalone View
Standalone View
src/interfaces/chain.cpp
Show First 20 Lines • Show All 252 Lines • ▼ Show 20 Lines | public: | ||||
CRPCCommand m_command; | CRPCCommand m_command; | ||||
const CRPCCommand *m_wrapped_command; | const CRPCCommand *m_wrapped_command; | ||||
}; | }; | ||||
class ChainImpl : public Chain { | class ChainImpl : public Chain { | ||||
public: | public: | ||||
std::unique_ptr<Chain::Lock> lock(bool try_lock) override { | std::unique_ptr<Chain::Lock> lock(bool try_lock) override { | ||||
auto result = std::make_unique<LockImpl>( | auto lock = std::make_unique<LockImpl>( | ||||
::cs_main, "cs_main", __FILE__, __LINE__, try_lock); | ::cs_main, "cs_main", __FILE__, __LINE__, try_lock); | ||||
if (try_lock && result && !*result) { | if (try_lock && lock && !*lock) { | ||||
return {}; | return {}; | ||||
} | } | ||||
// Temporary to avoid CWG 1579 | |||||
std::unique_ptr<Chain::Lock> result = std::move(lock); | |||||
return result; | return result; | ||||
} | } | ||||
bool findBlock(const BlockHash &hash, CBlock *block, int64_t *time, | bool findBlock(const BlockHash &hash, CBlock *block, int64_t *time, | ||||
int64_t *time_max) override { | int64_t *time_max) override { | ||||
CBlockIndex *index; | CBlockIndex *index; | ||||
{ | { | ||||
LOCK(cs_main); | LOCK(cs_main); | ||||
index = LookupBlockIndex(hash); | index = LookupBlockIndex(hash); | ||||
▲ Show 20 Lines • Show All 114 Lines • Show Last 20 Lines |