mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +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:
parent
4b1196a985
commit
fa1d49542e
16 changed files with 63 additions and 100 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue