Skip to content

Commit 1d74fc7

Browse files
committed
[trivial] Small style updates
1 parent ff6b908 commit 1d74fc7

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

src/net.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1843,7 +1843,7 @@ void CConnman::ThreadOpenConnections(const std::vector<std::string> connect)
18431843
// but inbound and manual peers do not use our outbound slots. Inbound peers
18441844
// also have the added issue that they could be attacker controlled and used
18451845
// to prevent us from connecting to particular hosts if we used them here.
1846-
switch(pnode->m_conn_type){
1846+
switch (pnode->m_conn_type) {
18471847
case ConnectionType::INBOUND:
18481848
case ConnectionType::MANUAL:
18491849
break;

src/net.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,7 @@ class CNode
823823
std::atomic_bool fPauseSend{false};
824824

825825
bool IsOutboundOrBlockRelayConn() const {
826-
switch(m_conn_type) {
826+
switch (m_conn_type) {
827827
case ConnectionType::OUTBOUND_FULL_RELAY:
828828
case ConnectionType::BLOCK_RELAY:
829829
return true;
@@ -868,7 +868,7 @@ class CNode
868868
}
869869

870870
bool ExpectServicesFromConn() const {
871-
switch(m_conn_type) {
871+
switch (m_conn_type) {
872872
case ConnectionType::INBOUND:
873873
case ConnectionType::MANUAL:
874874
case ConnectionType::FEELER:
@@ -892,7 +892,7 @@ class CNode
892892

893893
// flood relay
894894
std::vector<CAddress> vAddrToSend;
895-
std::unique_ptr<CRollingBloomFilter> m_addr_known = nullptr;
895+
std::unique_ptr<CRollingBloomFilter> m_addr_known{nullptr};
896896
bool fGetAddr{false};
897897
std::chrono::microseconds m_next_addr_send GUARDED_BY(cs_sendProcessing){0};
898898
std::chrono::microseconds m_next_local_addr_send GUARDED_BY(cs_sendProcessing){0};

src/net_processing.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -882,8 +882,9 @@ void PeerLogicValidation::InitializeNode(CNode *pnode) {
882882
LOCK(g_peer_mutex);
883883
g_peer_map.emplace_hint(g_peer_map.end(), nodeid, std::move(peer));
884884
}
885-
if(!pnode->IsInboundConn())
885+
if (!pnode->IsInboundConn()) {
886886
PushNodeVersion(*pnode, m_connman, GetTime());
887+
}
887888
}
888889

889890
void PeerLogicValidation::ReattemptInitialBroadcast(CScheduler& scheduler) const

src/test/denialofservice_tests.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ BOOST_AUTO_TEST_CASE(outbound_slow_chain_eviction)
8484

8585
// Mock an outbound peer
8686
CAddress addr1(ip(0xa0b0c001), NODE_NONE);
87-
CNode dummyNode1(id++, ServiceFlags(NODE_NETWORK|NODE_WITNESS), 0, INVALID_SOCKET, addr1, 0, 0, CAddress(), "", ConnectionType::OUTBOUND_FULL_RELAY);
87+
CNode dummyNode1(id++, ServiceFlags(NODE_NETWORK | NODE_WITNESS), 0, INVALID_SOCKET, addr1, 0, 0, CAddress(), "", ConnectionType::OUTBOUND_FULL_RELAY);
8888
dummyNode1.SetSendVersion(PROTOCOL_VERSION);
8989

9090
peerLogic->InitializeNode(&dummyNode1);
@@ -136,7 +136,7 @@ BOOST_AUTO_TEST_CASE(outbound_slow_chain_eviction)
136136
static void AddRandomOutboundPeer(std::vector<CNode *> &vNodes, PeerLogicValidation &peerLogic, CConnmanTest* connman)
137137
{
138138
CAddress addr(ip(g_insecure_rand_ctx.randbits(32)), NODE_NONE);
139-
vNodes.emplace_back(new CNode(id++, ServiceFlags(NODE_NETWORK|NODE_WITNESS), 0, INVALID_SOCKET, addr, 0, 0, CAddress(), "", ConnectionType::OUTBOUND_FULL_RELAY));
139+
vNodes.emplace_back(new CNode(id++, ServiceFlags(NODE_NETWORK | NODE_WITNESS), 0, INVALID_SOCKET, addr, 0, 0, CAddress(), "", ConnectionType::OUTBOUND_FULL_RELAY));
140140
CNode &node = *vNodes.back();
141141
node.SetSendVersion(PROTOCOL_VERSION);
142142

0 commit comments

Comments
 (0)