Changeset View
Changeset View
Standalone View
Standalone View
src/interfaces/chain.cpp
Show First 20 Lines • Show All 204 Lines • ▼ Show 20 Lines | public: | ||||
void UpdatedBlockTip(const CBlockIndex *index, | void UpdatedBlockTip(const CBlockIndex *index, | ||||
const CBlockIndex *fork_index, | const CBlockIndex *fork_index, | ||||
bool is_ibd) override { | bool is_ibd) override { | ||||
m_notifications->UpdatedBlockTip(); | m_notifications->UpdatedBlockTip(); | ||||
} | } | ||||
void ChainStateFlushed(const CBlockLocator &locator) override { | void ChainStateFlushed(const CBlockLocator &locator) override { | ||||
m_notifications->ChainStateFlushed(locator); | m_notifications->ChainStateFlushed(locator); | ||||
} | } | ||||
void ResendWalletTransactions(CConnman *) override { | |||||
// `cs_main` is always held when this method is called, so it is | |||||
// safe to call `assumeLocked`. This is awkward, and the | |||||
// `assumeLocked` method should be able to be removed entirely if | |||||
// `ResendWalletTransactions` is replaced by a wallet timer as | |||||
// suggested in https://github.com/bitcoin/bitcoin/issues/15619 | |||||
auto locked_chain = m_chain.assumeLocked(); | |||||
m_notifications->ResendWalletTransactions(*locked_chain); | |||||
} | |||||
Chain &m_chain; | Chain &m_chain; | ||||
Chain::Notifications *m_notifications; | Chain::Notifications *m_notifications; | ||||
}; | }; | ||||
class RpcHandlerImpl : public Handler { | class RpcHandlerImpl : public Handler { | ||||
public: | public: | ||||
RpcHandlerImpl(const CRPCCommand &command) | RpcHandlerImpl(const CRPCCommand &command) | ||||
: m_command(command), m_wrapped_command(&command) { | : m_command(command), m_wrapped_command(&command) { | ||||
▲ Show 20 Lines • Show All 120 Lines • ▼ Show 20 Lines | public: | ||||
CFeeRate estimateFee() const override { | CFeeRate estimateFee() const override { | ||||
return ::g_mempool.estimateFee(); | return ::g_mempool.estimateFee(); | ||||
} | } | ||||
CFeeRate relayMinFee() override { return ::minRelayTxFee; } | CFeeRate relayMinFee() override { return ::minRelayTxFee; } | ||||
CFeeRate relayDustFee() override { return ::dustRelayFee; } | CFeeRate relayDustFee() override { return ::dustRelayFee; } | ||||
Amount maxTxFee() override { return ::maxTxFee; } | Amount maxTxFee() override { return ::maxTxFee; } | ||||
bool getPruneMode() override { return ::fPruneMode; } | bool getPruneMode() override { return ::fPruneMode; } | ||||
bool p2pEnabled() override { return g_connman != nullptr; } | bool p2pEnabled() override { return g_connman != nullptr; } | ||||
bool isReadyToBroadcast() override { | |||||
return !::fImporting && !::fReindex && !IsInitialBlockDownload(); | |||||
} | |||||
bool isInitialBlockDownload() override { | bool isInitialBlockDownload() override { | ||||
return IsInitialBlockDownload(); | return IsInitialBlockDownload(); | ||||
} | } | ||||
bool shutdownRequested() override { return ShutdownRequested(); } | bool shutdownRequested() override { return ShutdownRequested(); } | ||||
int64_t getAdjustedTime() override { return GetAdjustedTime(); } | int64_t getAdjustedTime() override { return GetAdjustedTime(); } | ||||
void initMessage(const std::string &message) override { | void initMessage(const std::string &message) override { | ||||
::uiInterface.InitMessage(message); | ::uiInterface.InitMessage(message); | ||||
} | } | ||||
Show All 34 Lines |