Skip to content

Commit 3f845ea

Browse files
committed
node: add externalSigners to interface
1 parent 62ac119 commit 3f845ea

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/interfaces/node.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#define BITCOIN_INTERFACES_NODE_H
77

88
#include <amount.h> // For CAmount
9+
#include <external_signer.h>
910
#include <net.h> // For NodeId
1011
#include <net_types.h> // For banmap_t
1112
#include <netaddress.h> // For Network
@@ -110,6 +111,11 @@ class Node
110111
//! Disconnect node by id.
111112
virtual bool disconnectById(NodeId id) = 0;
112113

114+
#ifdef ENABLE_EXTERNAL_SIGNER
115+
//! List external signers
116+
virtual std::vector<ExternalSigner> externalSigners() = 0;
117+
#endif
118+
113119
//! Get total bytes recv.
114120
virtual int64_t getTotalBytesRecv() = 0;
115121

src/node/interfaces.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,16 @@ class NodeImpl : public Node
170170
}
171171
return false;
172172
}
173+
#ifdef ENABLE_EXTERNAL_SIGNER
174+
std::vector<ExternalSigner> externalSigners() override
175+
{
176+
std::vector<ExternalSigner> signers = {};
177+
const std::string command = gArgs.GetArg("-signer", "");
178+
if (command == "") return signers;
179+
ExternalSigner::Enumerate(command, signers, Params().NetworkIDString());
180+
return signers;
181+
}
182+
#endif
173183
int64_t getTotalBytesRecv() override { return m_context->connman ? m_context->connman->GetTotalBytesRecv() : 0; }
174184
int64_t getTotalBytesSent() override { return m_context->connman ? m_context->connman->GetTotalBytesSent() : 0; }
175185
size_t getMempoolSize() override { return m_context->mempool ? m_context->mempool->size() : 0; }

0 commit comments

Comments
 (0)