wallet: Introduce a callback called after TopUp completes

After TopUp completes, the wallet containing each SPKM will want to know
what new scriptPubKeys were generated. In order for all TopUp calls
(including ones internal the the SPKM), we use a callback function in
the WalletStorage interface.
This commit is contained in:
Ava Chow
2024-02-02 14:16:46 -05:00
parent b276825932
commit 99a0cddbc0
4 changed files with 28 additions and 0 deletions

View File

@@ -4334,4 +4334,14 @@ util::Result<MigrationResult> MigrateLegacyToDescriptor(const std::string& walle
}
return res;
}
void CWallet::CacheNewScriptPubKeys(const std::set<CScript>& spks, ScriptPubKeyMan* spkm)
{
}
void CWallet::TopUpCallback(const std::set<CScript>& spks, ScriptPubKeyMan* spkm)
{
// Update scriptPubKey cache
CacheNewScriptPubKeys(spks, spkm);
}
} // namespace wallet