Skip to content

Commit ae683c1

Browse files
committed
Avoid copying CNodeStats to make helgrind OK with buggy std::string
1 parent 644f123 commit ae683c1

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/net.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2420,9 +2420,8 @@ void CConnman::GetNodeStats(std::vector<CNodeStats>& vstats)
24202420
vstats.reserve(vNodes.size());
24212421
for(std::vector<CNode*>::iterator it = vNodes.begin(); it != vNodes.end(); ++it) {
24222422
CNode* pnode = *it;
2423-
CNodeStats stats;
2424-
pnode->copyStats(stats);
2425-
vstats.push_back(stats);
2423+
vstats.emplace_back();
2424+
pnode->copyStats(vstats.back());
24262425
}
24272426
}
24282427

0 commit comments

Comments
 (0)