net: merge V2Transport constructors, move key gen

This removes the ability for BIP324Cipher to generate its own key, moving that
responsibility to the caller (mostly, V2Transport). This allows us to write
the random-key V2Transport constructor by delegating to the explicit-key one.
This commit is contained in:
Pieter Wuille
2023-09-08 11:48:09 -04:00
parent c5a63ea56f
commit b6934fd03f
4 changed files with 30 additions and 23 deletions

View File

@@ -22,13 +22,6 @@
#include <iterator>
#include <string>
BIP324Cipher::BIP324Cipher() noexcept
{
m_key.MakeNewKey(true);
uint256 entropy = GetRandHash();
m_our_pubkey = m_key.EllSwiftCreate(MakeByteSpan(entropy));
}
BIP324Cipher::BIP324Cipher(const CKey& key, Span<const std::byte> ent32) noexcept :
m_key(key)
{