diff options
author | Sebastian Falbesoner <sebastian.falbesoner@gmail.com> | 2023-09-12 03:35:40 +0200 |
---|---|---|
committer | Sebastian Falbesoner <sebastian.falbesoner@gmail.com> | 2023-12-23 13:26:00 +0100 |
commit | fa1d49542e4b69a5d8b1177ffe4207f051a468bb (patch) | |
tree | 9c2cf8f46ea9d058c7c1c38d7244eb8eefc3b6fd /src/wallet/wallet.cpp | |
parent | 4b1196a9855dcd188a24f393aa2fa21e2d61f061 (diff) | |
download | bitcoin-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/wallet.cpp')
-rw-r--r-- | src/wallet/wallet.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 507174413d..70fb375efa 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -3578,8 +3578,7 @@ void CWallet::SetupDescriptorScriptPubKeyMans() if (!IsWalletFlagSet(WALLET_FLAG_EXTERNAL_SIGNER)) { // Make a seed - CKey seed_key; - seed_key.MakeNewKey(true); + CKey seed_key = GenerateRandomKey(); CPubKey seed = seed_key.GetPubKey(); assert(seed_key.VerifyPubKey(seed)); |