mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
Merge 1ba74123f9 into merged_master (Bitcoin PR bitcoin/bitcoin#23004)
This commit is contained in:
commit
0b69a1e205
5 changed files with 41 additions and 12 deletions
|
|
@ -67,6 +67,17 @@ using interfaces::WalletClient;
|
|||
|
||||
namespace node {
|
||||
namespace {
|
||||
#ifdef ENABLE_EXTERNAL_SIGNER
|
||||
class ExternalSignerImpl : public interfaces::ExternalSigner
|
||||
{
|
||||
public:
|
||||
ExternalSignerImpl(::ExternalSigner signer) : m_signer(std::move(signer)) {}
|
||||
std::string getName() override { return m_signer.m_name; }
|
||||
private:
|
||||
::ExternalSigner m_signer;
|
||||
};
|
||||
#endif
|
||||
|
||||
class NodeImpl : public Node
|
||||
{
|
||||
private:
|
||||
|
|
@ -172,14 +183,18 @@ public:
|
|||
}
|
||||
return false;
|
||||
}
|
||||
std::vector<ExternalSigner> externalSigners() override
|
||||
std::vector<std::unique_ptr<interfaces::ExternalSigner>> listExternalSigners() override
|
||||
{
|
||||
#ifdef ENABLE_EXTERNAL_SIGNER
|
||||
std::vector<ExternalSigner> signers = {};
|
||||
const std::string command = gArgs.GetArg("-signer", "");
|
||||
if (command == "") return signers;
|
||||
if (command == "") return {};
|
||||
ExternalSigner::Enumerate(command, signers, Params().NetworkIDString());
|
||||
return signers;
|
||||
std::vector<std::unique_ptr<interfaces::ExternalSigner>> result;
|
||||
for (auto& signer : signers) {
|
||||
result.emplace_back(std::make_unique<ExternalSignerImpl>(std::move(signer)));
|
||||
}
|
||||
return result;
|
||||
#else
|
||||
// This result is indistinguishable from a successful call that returns
|
||||
// no signers. For the current GUI this doesn't matter, because the wallet
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue