mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-31 19:06:10 +02:00
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(...)`.
This commit is contained in:
@@ -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));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user