diff options
author | Sjors Provoost <sjors@sprovoost.nl> | 2021-05-13 15:23:19 +0200 |
---|---|---|
committer | Sjors Provoost <sjors@sprovoost.nl> | 2021-06-16 10:48:58 +0200 |
commit | 4455145e266450397b45acd7286686966edd072b (patch) | |
tree | 4829ded062fa7b872330d876cd981dddfda30a6a /src/node | |
parent | 5be90c907eba0a38019c7d9826623d5d5f567c66 (diff) | |
download | bitcoin-4455145e266450397b45acd7286686966edd072b.tar.xz |
refactor: reduce #ifdef ENABLE_EXTERNAL_SIGNER usage
In particular this make the node interface independent on whether external signer support is compiled.
Diffstat (limited to 'src/node')
-rw-r--r-- | src/node/interfaces.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/node/interfaces.cpp b/src/node/interfaces.cpp index 37a5fe4b38..fce3c1809c 100644 --- a/src/node/interfaces.cpp +++ b/src/node/interfaces.cpp @@ -171,16 +171,24 @@ public: } return false; } -#ifdef ENABLE_EXTERNAL_SIGNER std::vector<ExternalSigner> externalSigners() override { +#ifdef ENABLE_EXTERNAL_SIGNER std::vector<ExternalSigner> signers = {}; const std::string command = gArgs.GetArg("-signer", ""); if (command == "") return signers; ExternalSigner::Enumerate(command, signers, Params().NetworkIDString()); return signers; +#else + // This result is undistinguisable from a succesful call that returns + // no signers. For the current GUI this doesn't matter, because the wallet + // creation dialog disables the external signer checkbox in both + // cases. The return type could be changed to std::optional<std::vector> + // (or something that also includes error messages) if this distinction + // becomes important. + return {}; +#endif // ENABLE_EXTERNAL_SIGNER } -#endif int64_t getTotalBytesRecv() override { return m_context->connman ? m_context->connman->GetTotalBytesRecv() : 0; } int64_t getTotalBytesSent() override { return m_context->connman ? m_context->connman->GetTotalBytesSent() : 0; } size_t getMempoolSize() override { return m_context->mempool ? m_context->mempool->size() : 0; } |