Changeset View
Changeset View
Standalone View
Standalone View
src/interfaces/node.h
// Copyright (c) 2018 The Bitcoin Core developers | // Copyright (c) 2018 The Bitcoin Core developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#ifndef BITCOIN_INTERFACES_NODE_H | #ifndef BITCOIN_INTERFACES_NODE_H | ||||
#define BITCOIN_INTERFACES_NODE_H | #define BITCOIN_INTERFACES_NODE_H | ||||
#include <addrdb.h> // For banmap_t | #include <addrdb.h> // For banmap_t | ||||
#include <amount.h> // For Amount | #include <amount.h> // For Amount | ||||
#include <net.h> // For CConnman::NumConnections | #include <net.h> // For CConnman::NumConnections | ||||
#include <netaddress.h> // For Network | #include <netaddress.h> // For Network | ||||
#include <support/allocators/secure.h> // For SecureString | |||||
#include <cstddef> | #include <cstddef> | ||||
#include <cstdint> | #include <cstdint> | ||||
#include <functional> | #include <functional> | ||||
#include <memory> | #include <memory> | ||||
#include <string> | #include <string> | ||||
#include <tuple> | #include <tuple> | ||||
#include <vector> | #include <vector> | ||||
class BanMan; | class BanMan; | ||||
class CCoinControl; | class CCoinControl; | ||||
class CFeeRate; | class CFeeRate; | ||||
struct CNodeStateStats; | struct CNodeStateStats; | ||||
struct CNodeStats; | struct CNodeStats; | ||||
class Coin; | class Coin; | ||||
class Config; | class Config; | ||||
class HTTPRPCRequestProcessor; | class HTTPRPCRequestProcessor; | ||||
struct NodeContext; | struct NodeContext; | ||||
class proxyType; | class proxyType; | ||||
class RPCServer; | class RPCServer; | ||||
class RPCTimerInterface; | class RPCTimerInterface; | ||||
class UniValue; | class UniValue; | ||||
enum class WalletCreationStatus; | |||||
namespace interfaces { | namespace interfaces { | ||||
class Handler; | class Handler; | ||||
class Wallet; | class Wallet; | ||||
//! Top-level interface for a bitcoin node (bitcoind process). | //! Top-level interface for a bitcoin node (bitcoind process). | ||||
class Node { | class Node { | ||||
public: | public: | ||||
▲ Show 20 Lines • Show All 161 Lines • ▼ Show 20 Lines | public: | ||||
//! Attempts to load a wallet from file or directory. | //! Attempts to load a wallet from file or directory. | ||||
//! The loaded wallet is also notified to handlers previously registered | //! The loaded wallet is also notified to handlers previously registered | ||||
//! with handleLoadWallet. | //! with handleLoadWallet. | ||||
virtual std::unique_ptr<Wallet> loadWallet(const CChainParams ¶ms, | virtual std::unique_ptr<Wallet> loadWallet(const CChainParams ¶ms, | ||||
const std::string &name, | const std::string &name, | ||||
std::string &error, | std::string &error, | ||||
std::string &warning) const = 0; | std::string &warning) const = 0; | ||||
//! Create a wallet from file | |||||
virtual WalletCreationStatus | |||||
createWallet(const CChainParams ¶ms, const SecureString &passphrase, | |||||
uint64_t wallet_creation_flags, const std::string &name, | |||||
std::string &error, std::string &warning, | |||||
std::unique_ptr<Wallet> &result) = 0; | |||||
//! Register handler for init messages. | //! Register handler for init messages. | ||||
using InitMessageFn = std::function<void(const std::string &message)>; | using InitMessageFn = std::function<void(const std::string &message)>; | ||||
virtual std::unique_ptr<Handler> handleInitMessage(InitMessageFn fn) = 0; | virtual std::unique_ptr<Handler> handleInitMessage(InitMessageFn fn) = 0; | ||||
//! Register handler for message box messages. | //! Register handler for message box messages. | ||||
using MessageBoxFn = | using MessageBoxFn = | ||||
std::function<bool(const std::string &message, | std::function<bool(const std::string &message, | ||||
const std::string &caption, unsigned int style)>; | const std::string &caption, unsigned int style)>; | ||||
▲ Show 20 Lines • Show All 63 Lines • Show Last 20 Lines |