mirror of
https://github.com/EvernodeXRPL/hpcore.git
synced 2026-04-29 15:37:59 +00:00
Added challenge issue and verification for peer connections (#93)
Implemented flatbuffer peer challenge issue and verification messages. Replaced session flags with challenge status enum.
This commit is contained in:
@@ -17,7 +17,6 @@ contract_config cfg;
|
||||
|
||||
const static char *MODE_OBSERVER = "observer";
|
||||
const static char *MODE_PROPOSER = "proposer";
|
||||
constexpr size_t PEERID_LEN = 16;
|
||||
|
||||
/**
|
||||
* Loads and initializes the contract config for execution. Must be called once during application startup.
|
||||
@@ -36,12 +35,6 @@ int init()
|
||||
// Append self peer to peer list.
|
||||
const std::string portstr = std::to_string(cfg.peerport);
|
||||
|
||||
// We calculate the self peer id to be a random string.
|
||||
// Use libsodium to generate the random challenge bytes.
|
||||
unsigned char peerid_bytes[PEERID_LEN];
|
||||
randombytes_buf(peerid_bytes, PEERID_LEN);
|
||||
util::bin2hex(cfg.self_peerid, peerid_bytes, PEERID_LEN);
|
||||
|
||||
cfg.peers.emplace(std::make_pair(SELF_HOST, cfg.peerport));
|
||||
|
||||
// Append self pubkey to unl list.
|
||||
|
||||
Reference in New Issue
Block a user