clang-format: Set PackConstructorInitializers: CurrentLine
What changed, and why it matters
This commit only changes code formatting rules. It tells the project's automated style tool (clang-format) to place constructor initializer list items on separate lines instead of packing them together. The only code change is a reformatting of one constructor in net.cpp to match the new style. There is no functional change to the Bitcoin software and no security impact.
No security action needed. This is a cosmetic/style-only change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit modifies src/.clang-format, changing PackConstructorInitializers from BinPack to CurrentLine. This is a pure formatting configuration change. The accompanying change in src/net.cpp is the result of applying that style rule to the V2Transport constructor initializer list, splitting it across multiple lines. No logic, behavior, or binary output is altered.
Changed components
src/.clang-formatsrc/net.cpp (formatting only)Inspect captured patch +4 / −2
diff --git a/src/.clang-format b/src/.clang-format
index dd3f1070..c1c0e892 100644
--- a/src/.clang-format
+++ b/src/.clang-format
@@ -146,7 +146,7 @@ ObjCBlockIndentWidth: 2
ObjCBreakBeforeNestedBlockParam: true
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
-PackConstructorInitializers: BinPack
+PackConstructorInitializers: CurrentLine
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
diff --git a/src/net.cpp b/src/net.cpp
index 3148c7e9..d335f2dc 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -995,7 +995,9 @@ void V2Transport::StartSendingHandshake() noexcept
}
V2Transport::V2Transport(NodeId nodeid, bool initiating, const CKey& key, std::span<const std::byte> ent32, std::vector<uint8_t> garbage) noexcept
- : m_cipher{key, ent32}, m_initiating{initiating}, m_nodeid{nodeid},
+ : m_cipher{key, ent32},
+ m_initiating{initiating},
+ m_nodeid{nodeid},
m_v1_fallback{nodeid},
m_recv_state{initiating ? RecvState::KEY : RecvState::KEY_MAYBE_V1},
m_send_garbage{std::move(garbage)},
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.