signals: Use a lambda to avoid connecting a signal to another signal

This is undocumented and unspecified Boost behavior that happens to work as
intended for now, but could break at any point in the future.

See the boost discussion here: https://groups.google.com/g/boost-list/c/So4i8JXneJ0

It also complicates a potential replacement of Boost::signals2.
This commit is contained in:
Cory Fields
2026-01-28 20:25:34 +00:00
parent f7e0c3d3d3
commit fd5e9d9904

View File

@@ -3549,7 +3549,9 @@ bool CWallet::HaveCryptedKeys() const
void CWallet::ConnectScriptPubKeyManNotifiers()
{
for (const auto& spk_man : GetActiveScriptPubKeyMans()) {
spk_man->NotifyCanGetAddressesChanged.connect(NotifyCanGetAddressesChanged);
spk_man->NotifyCanGetAddressesChanged.connect([this] {
NotifyCanGetAddressesChanged();
});
spk_man->NotifyFirstKeyTimeChanged.connect([this](const ScriptPubKeyMan*, int64_t time) {
MaybeUpdateBirthTime(time);
});