aboutsummaryrefslogtreecommitdiff
path: root/src/net.h
diff options
context:
space:
mode:
authorHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2020-09-19 11:52:27 +0300
committerHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2020-09-19 17:50:58 +0300
commit73f71e19965e07534eb47701f2b23c9ed59ef475 (patch)
treec660c5a5933c4577d965adce2109003ce5ed40b8 /src/net.h
parentc30f79d418e2e001f1f804a2370db47e5d9ea587 (diff)
refactor: Use explicit function type instead of template
Diffstat (limited to 'src/net.h')
-rw-r--r--src/net.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/net.h b/src/net.h
index 60c3dc6aef..b0294d5b15 100644
--- a/src/net.h
+++ b/src/net.h
@@ -258,8 +258,8 @@ public:
void PushMessage(CNode* pnode, CSerializedNetMsg&& msg);
- template<typename Callable>
- void ForEachNode(Callable&& func)
+ using NodeFn = std::function<void(CNode*)>;
+ void ForEachNode(const NodeFn& func)
{
LOCK(cs_vNodes);
for (auto&& node : vNodes) {
@@ -268,8 +268,7 @@ public:
}
};
- template<typename Callable>
- void ForEachNode(Callable&& func) const
+ void ForEachNode(const NodeFn& func) const
{
LOCK(cs_vNodes);
for (auto&& node : vNodes) {