aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet.cpp
diff options
context:
space:
mode:
authorAndrew Chow <achow101-github@achow101.com>2019-08-14 14:25:53 -0400
committerAndrew Chow <achow101-github@achow101.com>2020-04-23 13:59:48 -0400
commitce24a944940019185efebcc5d85eac458ed26016 (patch)
tree82772b6c25fcecd552f51703f4a68326ff7326d5 /src/wallet/wallet.cpp
parent1cb42b22b11c27e64462afc25a94b2fc50bfa113 (diff)
Add IsLegacy to CWallet so that the GUI knows whether to show watchonly
Diffstat (limited to 'src/wallet/wallet.cpp')
-rw-r--r--src/wallet/wallet.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp
index fec2a39906..82901e09de 100644
--- a/src/wallet/wallet.cpp
+++ b/src/wallet/wallet.cpp
@@ -4412,3 +4412,12 @@ void CWallet::SetActiveScriptPubKeyMan(uint256 id, OutputType type, bool interna
}
NotifyCanGetAddressesChanged();
}
+
+bool CWallet::IsLegacy() const
+{
+ if (m_internal_spk_managers.count(OutputType::LEGACY) == 0) {
+ return false;
+ }
+ auto spk_man = dynamic_cast<LegacyScriptPubKeyMan*>(m_internal_spk_managers.at(OutputType::LEGACY));
+ return spk_man != nullptr;
+}