Skip to content

Commit c7eb19e

Browse files
committed
style: remove unnecessary braces
They were needed to define the scope of `LOCK(cs_vNodes)` which was removed in the previous commit. Re-indent in a separate commit to ease review (use `--ignore-space-change`).
1 parent 664ac22 commit c7eb19e

File tree

1 file changed

+28
-30
lines changed

1 file changed

+28
-30
lines changed

src/net.cpp

Lines changed: 28 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1340,38 +1340,36 @@ bool CConnman::GenerateSelectSet(const std::vector<CNode*>& nodes,
13401340
recv_set.insert(hListenSocket.socket);
13411341
}
13421342

1343-
{
1344-
for (CNode* pnode : nodes) {
1345-
// Implement the following logic:
1346-
// * If there is data to send, select() for sending data. As this only
1347-
// happens when optimistic write failed, we choose to first drain the
1348-
// write buffer in this case before receiving more. This avoids
1349-
// needlessly queueing received data, if the remote peer is not themselves
1350-
// receiving data. This means properly utilizing TCP flow control signalling.
1351-
// * Otherwise, if there is space left in the receive buffer, select() for
1352-
// receiving data.
1353-
// * Hand off all complete messages to the processor, to be handled without
1354-
// blocking here.
1355-
1356-
bool select_recv = !pnode->fPauseRecv;
1357-
bool select_send;
1358-
{
1359-
LOCK(pnode->cs_vSend);
1360-
select_send = !pnode->vSendMsg.empty();
1361-
}
1343+
for (CNode* pnode : nodes) {
1344+
// Implement the following logic:
1345+
// * If there is data to send, select() for sending data. As this only
1346+
// happens when optimistic write failed, we choose to first drain the
1347+
// write buffer in this case before receiving more. This avoids
1348+
// needlessly queueing received data, if the remote peer is not themselves
1349+
// receiving data. This means properly utilizing TCP flow control signalling.
1350+
// * Otherwise, if there is space left in the receive buffer, select() for
1351+
// receiving data.
1352+
// * Hand off all complete messages to the processor, to be handled without
1353+
// blocking here.
1354+
1355+
bool select_recv = !pnode->fPauseRecv;
1356+
bool select_send;
1357+
{
1358+
LOCK(pnode->cs_vSend);
1359+
select_send = !pnode->vSendMsg.empty();
1360+
}
13621361

1363-
LOCK(pnode->cs_hSocket);
1364-
if (pnode->hSocket == INVALID_SOCKET)
1365-
continue;
1362+
LOCK(pnode->cs_hSocket);
1363+
if (pnode->hSocket == INVALID_SOCKET)
1364+
continue;
13661365

1367-
error_set.insert(pnode->hSocket);
1368-
if (select_send) {
1369-
send_set.insert(pnode->hSocket);
1370-
continue;
1371-
}
1372-
if (select_recv) {
1373-
recv_set.insert(pnode->hSocket);
1374-
}
1366+
error_set.insert(pnode->hSocket);
1367+
if (select_send) {
1368+
send_set.insert(pnode->hSocket);
1369+
continue;
1370+
}
1371+
if (select_recv) {
1372+
recv_set.insert(pnode->hSocket);
13751373
}
13761374
}
13771375

0 commit comments

Comments
 (0)