forked from ElementsProject/elements
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wallet: add -signer argument for external signer command
Create basic ExternalSigner class with contructor. A Signer(<cmd>) is added to CWallet on load if -signer=<cmd> is set.
- Loading branch information
Showing
6 changed files
with
49 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// Copyright (c) 2018-2021 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 <wallet/external_signer.h> | ||
#include <util/system.h> | ||
|
||
ExternalSigner::ExternalSigner(const std::string& command, const std::string& fingerprint): m_command(command), m_fingerprint(fingerprint) {} |
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,34 @@ | ||
// Copyright (c) 2018-2021 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_WALLET_EXTERNAL_SIGNER_H | ||
#define BITCOIN_WALLET_EXTERNAL_SIGNER_H | ||
|
||
#include <stdexcept> | ||
#include <string> | ||
#include <univalue.h> | ||
|
||
class ExternalSignerException : public std::runtime_error { | ||
public: | ||
using std::runtime_error::runtime_error; | ||
}; | ||
|
||
//! Enables interaction with an external signing device or service, such as | ||
//! a hardware wallet. See doc/external-signer.md | ||
class ExternalSigner | ||
{ | ||
private: | ||
//! The command which handles interaction with the external signer. | ||
std::string m_command; | ||
|
||
public: | ||
//! @param[in] command the command which handles interaction with the external signer | ||
//! @param[in] fingerprint master key fingerprint of the signer | ||
ExternalSigner(const std::string& command, const std::string& fingerprint); | ||
|
||
//! Master key fingerprint of the signer | ||
std::string m_fingerprint; | ||
}; | ||
|
||
#endif // BITCOIN_WALLET_EXTERNAL_SIGNER_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
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