Notify the GUI that the keypool has changed to set the receive button

Whenever the keypool changes (new keys generated, new seed set,
keypool runs out, etc.), notify the GUI that the keypool has changed. The
receive button can then be enabled and disabled as necessary.
This commit is contained in:
Andrew Chow
2019-01-18 17:05:32 -05:00
parent 14bcdbe09c
commit 2bc4c3eaf9
7 changed files with 37 additions and 1 deletions

View File

@@ -488,6 +488,10 @@ public:
{
return MakeHandler(m_wallet.NotifyWatchonlyChanged.connect(fn));
}
std::unique_ptr<Handler> handleCanGetAddressesChanged(CanGetAddressesChangedFn fn) override
{
return MakeHandler(m_wallet.NotifyCanGetAddressesChanged.connect(fn));
}
std::shared_ptr<CWallet> m_shared_wallet;
CWallet& m_wallet;

View File

@@ -271,6 +271,10 @@ public:
//! Register handler for watchonly changed messages.
using WatchOnlyChangedFn = std::function<void(bool have_watch_only)>;
virtual std::unique_ptr<Handler> handleWatchOnlyChanged(WatchOnlyChangedFn fn) = 0;
//! Register handler for keypool changed messages.
using CanGetAddressesChangedFn = std::function<void()>;
virtual std::unique_ptr<Handler> handleCanGetAddressesChanged(CanGetAddressesChangedFn fn) = 0;
};
//! Tracking object returned by CreateTransaction and passed to CommitTransaction.