DEVNET storage port fixes

On devnet we don't have a storage server, and so storage ports are left
uninitialized and effectively become random ports on the network.  This
initializes them to 0, and avoids comparing SS ports for devnet for the
duplicate ip/ports warning.
This commit is contained in:
Jason Rhinelander 2022-05-25 14:40:38 -03:00
parent acf2942859
commit a8a3b3dbe6
No known key found for this signature in database
GPG Key ID: C4992CE7A88D4262
2 changed files with 3 additions and 2 deletions

View File

@ -2289,7 +2289,8 @@ namespace cryptonote
m_service_node_list.for_each_service_node_info_and_proof(sn_pks.begin(), sn_pks.end(), [&](auto& pk, auto& sni, auto& proof) {
if (pk != m_service_keys.pub && proof.proof->public_ip == m_sn_public_ip &&
(proof.proof->qnet_port == m_quorumnet_port || proof.proof->storage_https_port == storage_https_port() || proof.proof->storage_omq_port == storage_omq_port()))
(proof.proof->qnet_port == m_quorumnet_port || (
m_nettype != network_type::DEVNET && (proof.proof->storage_https_port == storage_https_port() || proof.proof->storage_omq_port == storage_omq_port()))))
MGINFO_RED(
"Another service node (" << pk << ") is broadcasting the same public IP and ports as this service node (" <<
epee::string_tools::get_ip_string_from_int32(m_sn_public_ip) << ":" << proof.proof->qnet_port << "[qnet], :" <<

View File

@ -975,7 +975,7 @@ namespace cryptonote
/// Time point at which the storage server and lokinet last pinged us
std::atomic<time_t> m_last_storage_server_ping, m_last_lokinet_ping;
std::atomic<uint16_t> m_storage_https_port, m_storage_omq_port;
std::atomic<uint16_t> m_storage_https_port{0}, m_storage_omq_port{0};
uint32_t sn_public_ip() const { return m_sn_public_ip; }
uint16_t storage_https_port() const { return m_storage_https_port; }