Changeset View
Changeset View
Standalone View
Standalone View
src/interfaces/chain.h
Show First 20 Lines • Show All 54 Lines • ▼ Show 20 Lines | |||||
//! * The relayTransactions() and submitToMemoryPool() methods could be replaced | //! * The relayTransactions() and submitToMemoryPool() methods could be replaced | ||||
//! with a higher-level broadcastTransaction method | //! with a higher-level broadcastTransaction method | ||||
//! (https://github.com/bitcoin/bitcoin/pull/14978#issuecomment-459373984). | //! (https://github.com/bitcoin/bitcoin/pull/14978#issuecomment-459373984). | ||||
//! | //! | ||||
//! * The initMessages() and loadWallet() methods which the wallet uses to send | //! * The initMessages() and loadWallet() methods which the wallet uses to send | ||||
//! notifications to the GUI should go away when GUI and wallet can directly | //! notifications to the GUI should go away when GUI and wallet can directly | ||||
//! communicate with each other without going through the node | //! communicate with each other without going through the node | ||||
//! (https://github.com/bitcoin/bitcoin/pull/15288#discussion_r253321096). | //! (https://github.com/bitcoin/bitcoin/pull/15288#discussion_r253321096). | ||||
//! | |||||
//! * The handleRpc, registerRpcs, rpcEnableDeprecated methods and other RPC | |||||
//! methods can go away if wallets listen for HTTP requests on their own | |||||
//! ports instead of registering to handle requests on the node HTTP port. | |||||
class Chain { | class Chain { | ||||
public: | public: | ||||
virtual ~Chain() {} | virtual ~Chain() {} | ||||
//! Interface for querying locked chain state, used by legacy code that | //! Interface for querying locked chain state, used by legacy code that | ||||
//! assumes state won't change between calls. New code should avoid using | //! assumes state won't change between calls. New code should avoid using | ||||
//! the Lock interface and instead call higher-level Chain methods | //! the Lock interface and instead call higher-level Chain methods | ||||
//! that return more information so the chain doesn't need to stay locked | //! that return more information so the chain doesn't need to stay locked | ||||
▲ Show 20 Lines • Show All 195 Lines • ▼ Show 20 Lines | public: | ||||
//! Wait for pending notifications to be handled. | //! Wait for pending notifications to be handled. | ||||
virtual void waitForNotifications() = 0; | virtual void waitForNotifications() = 0; | ||||
//! Register handler for RPC. Command is not copied, so reference | //! Register handler for RPC. Command is not copied, so reference | ||||
//! needs to remain valid until Handler is disconnected. | //! needs to remain valid until Handler is disconnected. | ||||
virtual std::unique_ptr<Handler> handleRpc(const CRPCCommand &command) = 0; | virtual std::unique_ptr<Handler> handleRpc(const CRPCCommand &command) = 0; | ||||
//! Check if deprecated RPC is enabled. | |||||
virtual bool rpcEnableDeprecated(const std::string &method) = 0; | |||||
//! Run function after given number of seconds. Cancel any previous calls | |||||
//! with same name. | |||||
virtual void rpcRunLater(const std::string &name, std::function<void()> fn, | |||||
int64_t seconds) = 0; | |||||
//! Current RPC serialization flags. | |||||
virtual int rpcSerializationFlags() = 0; | |||||
//! Synchronously send TransactionAddedToMempool notifications about all | //! Synchronously send TransactionAddedToMempool notifications about all | ||||
//! current mempool transactions to the specified handler and return after | //! current mempool transactions to the specified handler and return after | ||||
//! the last one is sent. These notifications aren't coordinated with async | //! the last one is sent. These notifications aren't coordinated with async | ||||
//! notifications sent by handleNotifications, so out of date async | //! notifications sent by handleNotifications, so out of date async | ||||
//! notifications from handleNotifications can arrive during and after | //! notifications from handleNotifications can arrive during and after | ||||
//! synchronous notifications from requestMempoolTransactions. Clients need | //! synchronous notifications from requestMempoolTransactions. Clients need | ||||
//! to be prepared to handle this by ignoring notifications about unknown | //! to be prepared to handle this by ignoring notifications about unknown | ||||
//! removed transactions and already added new transactions. | //! removed transactions and already added new transactions. | ||||
▲ Show 20 Lines • Show All 45 Lines • Show Last 20 Lines |