aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmiti Uttarwar <amiti@uttarwar.org>2020-08-11 10:36:42 -0700
committerAmiti Uttarwar <amiti@uttarwar.org>2020-09-02 17:18:21 -0700
commit1d74fc7df621b31d1b8adc9d7f53e7478d6e40b5 (patch)
treeb484e4143c7c0f3b120148738e64aff2ff709d09
parentff6b9081add3a40d53b1cc1352b57eeb46e41d45 (diff)
downloadbitcoin-1d74fc7df621b31d1b8adc9d7f53e7478d6e40b5.tar.xz
[trivial] Small style updates
-rw-r--r--src/net.cpp2
-rw-r--r--src/net.h6
-rw-r--r--src/net_processing.cpp3
-rw-r--r--src/test/denialofservice_tests.cpp4
4 files changed, 8 insertions, 7 deletions
diff --git a/src/net.cpp b/src/net.cpp
index 0a9a8f7fb4..b0597093e8 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -1843,7 +1843,7 @@ void CConnman::ThreadOpenConnections(const std::vector<std::string> connect)
// but inbound and manual peers do not use our outbound slots. Inbound peers
// also have the added issue that they could be attacker controlled and used
// to prevent us from connecting to particular hosts if we used them here.
- switch(pnode->m_conn_type){
+ switch (pnode->m_conn_type) {
case ConnectionType::INBOUND:
case ConnectionType::MANUAL:
break;
diff --git a/src/net.h b/src/net.h
index a4830d09e9..75e0657d3d 100644
--- a/src/net.h
+++ b/src/net.h
@@ -823,7 +823,7 @@ public:
std::atomic_bool fPauseSend{false};
bool IsOutboundOrBlockRelayConn() const {
- switch(m_conn_type) {
+ switch (m_conn_type) {
case ConnectionType::OUTBOUND_FULL_RELAY:
case ConnectionType::BLOCK_RELAY:
return true;
@@ -868,7 +868,7 @@ public:
}
bool ExpectServicesFromConn() const {
- switch(m_conn_type) {
+ switch (m_conn_type) {
case ConnectionType::INBOUND:
case ConnectionType::MANUAL:
case ConnectionType::FEELER:
@@ -892,7 +892,7 @@ public:
// flood relay
std::vector<CAddress> vAddrToSend;
- std::unique_ptr<CRollingBloomFilter> m_addr_known = nullptr;
+ std::unique_ptr<CRollingBloomFilter> m_addr_known{nullptr};
bool fGetAddr{false};
std::chrono::microseconds m_next_addr_send GUARDED_BY(cs_sendProcessing){0};
std::chrono::microseconds m_next_local_addr_send GUARDED_BY(cs_sendProcessing){0};
diff --git a/src/net_processing.cpp b/src/net_processing.cpp
index dae77dabfb..b419ee7e61 100644
--- a/src/net_processing.cpp
+++ b/src/net_processing.cpp
@@ -882,8 +882,9 @@ void PeerLogicValidation::InitializeNode(CNode *pnode) {
LOCK(g_peer_mutex);
g_peer_map.emplace_hint(g_peer_map.end(), nodeid, std::move(peer));
}
- if(!pnode->IsInboundConn())
+ if (!pnode->IsInboundConn()) {
PushNodeVersion(*pnode, m_connman, GetTime());
+ }
}
void PeerLogicValidation::ReattemptInitialBroadcast(CScheduler& scheduler) const
diff --git a/src/test/denialofservice_tests.cpp b/src/test/denialofservice_tests.cpp
index 028d3d482b..bf0659587c 100644
--- a/src/test/denialofservice_tests.cpp
+++ b/src/test/denialofservice_tests.cpp
@@ -84,7 +84,7 @@ BOOST_AUTO_TEST_CASE(outbound_slow_chain_eviction)
// Mock an outbound peer
CAddress addr1(ip(0xa0b0c001), NODE_NONE);
- CNode dummyNode1(id++, ServiceFlags(NODE_NETWORK|NODE_WITNESS), 0, INVALID_SOCKET, addr1, 0, 0, CAddress(), "", ConnectionType::OUTBOUND_FULL_RELAY);
+ CNode dummyNode1(id++, ServiceFlags(NODE_NETWORK | NODE_WITNESS), 0, INVALID_SOCKET, addr1, 0, 0, CAddress(), "", ConnectionType::OUTBOUND_FULL_RELAY);
dummyNode1.SetSendVersion(PROTOCOL_VERSION);
peerLogic->InitializeNode(&dummyNode1);
@@ -136,7 +136,7 @@ BOOST_AUTO_TEST_CASE(outbound_slow_chain_eviction)
static void AddRandomOutboundPeer(std::vector<CNode *> &vNodes, PeerLogicValidation &peerLogic, CConnmanTest* connman)
{
CAddress addr(ip(g_insecure_rand_ctx.randbits(32)), NODE_NONE);
- vNodes.emplace_back(new CNode(id++, ServiceFlags(NODE_NETWORK|NODE_WITNESS), 0, INVALID_SOCKET, addr, 0, 0, CAddress(), "", ConnectionType::OUTBOUND_FULL_RELAY));
+ vNodes.emplace_back(new CNode(id++, ServiceFlags(NODE_NETWORK | NODE_WITNESS), 0, INVALID_SOCKET, addr, 0, 0, CAddress(), "", ConnectionType::OUTBOUND_FULL_RELAY));
CNode &node = *vNodes.back();
node.SetSendVersion(PROTOCOL_VERSION);