aboutsummaryrefslogtreecommitdiff
path: root/src/net.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/net.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/net.cpp')
-rw-r--r--src/net.cpp8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/net.cpp b/src/net.cpp
index 102d81579f..41f5323d91 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -18,6 +18,7 @@
#include <consensus/consensus.h>
#include <crypto/sha256.h>
#include <i2p.h>
+#include <key.h>
#include <logging.h>
#include <memusage.h>
#include <net_permissions.h>
@@ -938,13 +939,6 @@ public:
const V2MessageMap V2_MESSAGE_MAP;
-CKey GenerateRandomKey() noexcept
-{
- CKey key;
- key.MakeNewKey(/*fCompressed=*/true);
- return key;
-}
-
std::vector<uint8_t> GenerateRandomGarbage() noexcept
{
std::vector<uint8_t> ret;