-
Notifications
You must be signed in to change notification settings - Fork 386
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add skeleton chain and client classes
This commit does not change behavior. It just adds new skeleton classes that don't do anything and aren't instantiated yet.
- Loading branch information
Showing
6 changed files
with
98 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Copyright (c) 2018 The Bitcoin Core developers | ||
// Distributed under the MIT software license, see the accompanying | ||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||
|
||
#include <interfaces/chain.h> | ||
|
||
#include <util/system.h> | ||
|
||
namespace interfaces { | ||
namespace { | ||
|
||
class ChainImpl : public Chain | ||
{ | ||
}; | ||
|
||
} // namespace | ||
|
||
std::unique_ptr<Chain> MakeChain() { return MakeUnique<ChainImpl>(); } | ||
|
||
} // namespace interfaces |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// Copyright (c) 2018 The Bitcoin Core developers | ||
// Distributed under the MIT software license, see the accompanying | ||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||
|
||
#ifndef BITCOIN_INTERFACES_CHAIN_H | ||
#define BITCOIN_INTERFACES_CHAIN_H | ||
|
||
#include <memory> | ||
#include <string> | ||
#include <vector> | ||
|
||
namespace interfaces { | ||
|
||
//! Interface for giving wallet processes access to blockchain state. | ||
class Chain | ||
{ | ||
public: | ||
virtual ~Chain() {} | ||
}; | ||
|
||
//! Interface to let node manage chain clients (wallets, or maybe tools for | ||
//! monitoring and analysis in the future). | ||
class ChainClient | ||
{ | ||
public: | ||
virtual ~ChainClient() {} | ||
}; | ||
|
||
//! Return implementation of Chain interface. | ||
std::unique_ptr<Chain> MakeChain(); | ||
|
||
//! Return implementation of ChainClient interface for a wallet client. This | ||
//! function will be undefined in builds where ENABLE_WALLET is false. | ||
//! | ||
//! Currently, wallets are the only chain clients. But in the future, other | ||
//! types of chain clients could be added, such as tools for monitoring, | ||
//! analysis, or fee estimation. These clients need to expose their own | ||
//! MakeXXXClient functions returning their implementations of the ChainClient | ||
//! interface. | ||
std::unique_ptr<ChainClient> MakeWalletClient(Chain& chain, std::vector<std::string> wallet_filenames); | ||
|
||
} // namespace interfaces | ||
|
||
#endif // BITCOIN_INTERFACES_CHAIN_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters