mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 23:18:14 +01: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:
@@ -47,8 +47,7 @@ BOOST_AUTO_TEST_CASE(ismine_standard)
|
||||
pubkeys[i] = keys[i].GetPubKey();
|
||||
}
|
||||
|
||||
CKey uncompressedKey;
|
||||
uncompressedKey.MakeNewKey(false);
|
||||
CKey uncompressedKey = GenerateRandomKey(/*compressed=*/false);
|
||||
CPubKey uncompressedPubkey = uncompressedKey.GetPubKey();
|
||||
std::unique_ptr<interfaces::Chain>& chain = m_node.chain;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user