aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet.cpp
diff options
context:
space:
mode:
authorSjors Provoost <sjors@sprovoost.nl>2020-02-19 14:33:37 +0100
committerSjors Provoost <sjors@sprovoost.nl>2021-02-23 14:34:31 +0100
commit245b4457cf9265190a05529a0a97e1cb258cca8a (patch)
treedb47c62fb253880cbc1ed7b4284ac39b9782d5bc /src/wallet/wallet.cpp
parent7ebc7c0215979c53b92a436acc8b5b607b8d735a (diff)
downloadbitcoin-245b4457cf9265190a05529a0a97e1cb258cca8a.tar.xz
rpc: signerdisplayaddress
Diffstat (limited to 'src/wallet/wallet.cpp')
-rw-r--r--src/wallet/wallet.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp
index 795299d103..7c15438067 100644
--- a/src/wallet/wallet.cpp
+++ b/src/wallet/wallet.cpp
@@ -3587,6 +3587,25 @@ ExternalSigner CWallet::GetExternalSigner()
}
#endif
+bool CWallet::DisplayAddress(const CTxDestination& dest)
+{
+#ifdef ENABLE_EXTERNAL_SIGNER
+ CScript scriptPubKey = GetScriptForDestination(dest);
+ const auto spk_man = GetScriptPubKeyMan(scriptPubKey);
+ if (spk_man == nullptr) {
+ return false;
+ }
+ auto signer_spk_man = dynamic_cast<ExternalSignerScriptPubKeyMan*>(spk_man);
+ if (signer_spk_man == nullptr) {
+ return false;
+ }
+ ExternalSigner signer = GetExternalSigner(); // TODO: move signer in spk_man
+ return signer_spk_man->DisplayAddress(scriptPubKey, signer);
+#else
+ return false;
+#endif
+}
+
void CWallet::LockCoin(const COutPoint& output)
{
AssertLockHeld(cs_wallet);