aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/scriptpubkeyman.cpp
diff options
context:
space:
mode:
authorSebastian Falbesoner <sebastian.falbesoner@gmail.com>2023-09-12 03:35:40 +0200
committerSebastian Falbesoner <sebastian.falbesoner@gmail.com>2023-12-23 13:26:00 +0100
commitfa1d49542e4b69a5d8b1177ffe4207f051a468bb (patch)
tree9c2cf8f46ea9d058c7c1c38d7244eb8eefc3b6fd /src/wallet/scriptpubkeyman.cpp
parent4b1196a9855dcd188a24f393aa2fa21e2d61f061 (diff)
downloadbitcoin-fa1d49542e4b69a5d8b1177ffe4207f051a468bb.tar.xz
refactor: share and use `GenerateRandomKey` helper
Making the `GenerateRandomKey` helper available to other modules via key.{h.cpp} allows us to create random private keys directly at instantiation of CKey, in contrast to the two-step process of creating the instance and then having to call `MakeNewKey(...)`.
Diffstat (limited to 'src/wallet/scriptpubkeyman.cpp')
-rw-r--r--src/wallet/scriptpubkeyman.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/wallet/scriptpubkeyman.cpp b/src/wallet/scriptpubkeyman.cpp
index 70705667b0..8f0b72c2b0 100644
--- a/src/wallet/scriptpubkeyman.cpp
+++ b/src/wallet/scriptpubkeyman.cpp
@@ -1183,8 +1183,7 @@ bool LegacyScriptPubKeyMan::CanGenerateKeys() const
CPubKey LegacyScriptPubKeyMan::GenerateNewSeed()
{
assert(!m_storage.IsWalletFlagSet(WALLET_FLAG_DISABLE_PRIVATE_KEYS));
- CKey key;
- key.MakeNewKey(true);
+ CKey key = GenerateRandomKey();
return DeriveNewSeed(key);
}