mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 15:09:59 +01:00
wallet: Cache SigningProviders
In order to avoid constantly re-deriving the same keys in DescriptorScriptPubKeyMan, cache the SigningProviders generated inside of GetSigningProvider.
This commit is contained in:
@@ -547,6 +547,8 @@ private:
|
||||
|
||||
KeyMap GetKeys() const EXCLUSIVE_LOCKS_REQUIRED(cs_desc_man);
|
||||
|
||||
// Cached FlatSigningProviders to avoid regenerating them each time they are needed.
|
||||
mutable std::map<int32_t, FlatSigningProvider> m_map_signing_providers;
|
||||
// Fetch the SigningProvider for the given script and optionally include private keys
|
||||
std::unique_ptr<FlatSigningProvider> GetSigningProvider(const CScript& script, bool include_private = false) const;
|
||||
// Fetch the SigningProvider for the given pubkey and always include private keys. This should only be called by signing code.
|
||||
|
||||
Reference in New Issue
Block a user