mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-07 22:28:02 +02:00
Refactor: Copy CWallet signals and print function to LegacyScriptPubKeyMan
This commit does not change behavior.
This commit is contained in:
@@ -56,6 +56,7 @@ bool AddWallet(const std::shared_ptr<CWallet>& wallet)
|
||||
std::vector<std::shared_ptr<CWallet>>::const_iterator i = std::find(vpwallets.begin(), vpwallets.end(), wallet);
|
||||
if (i != vpwallets.end()) return false;
|
||||
vpwallets.push_back(wallet);
|
||||
wallet->ConnectScriptPubKeyManNotifiers();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -4218,3 +4219,11 @@ bool CWallet::HasEncryptionKeys() const
|
||||
{
|
||||
return !mapMasterKeys.empty();
|
||||
}
|
||||
|
||||
void CWallet::ConnectScriptPubKeyManNotifiers()
|
||||
{
|
||||
for (const auto& spk_man : GetActiveScriptPubKeyMans()) {
|
||||
spk_man->NotifyWatchonlyChanged.connect(NotifyWatchonlyChanged);
|
||||
spk_man->NotifyCanGetAddressesChanged.connect(NotifyCanGetAddressesChanged);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user