aboutsummaryrefslogtreecommitdiff
path: root/src/network.cpp
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2019-06-17 02:13:46 -0400
committerDeterminant <[email protected]>2019-06-17 02:13:46 -0400
commitc69b0150fe0c50b91c7c8a406f096de8e9cf62fc (patch)
treea8643b0db8133cf022b1b2854329fec633dd805d /src/network.cpp
parent4dc7feb8b15e0a76cc95e5a80fce363cca637856 (diff)
add unknown peer callback to C API
Diffstat (limited to 'src/network.cpp')
-rw-r--r--src/network.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/network.cpp b/src/network.cpp
index 0a83e39..8094ff2 100644
--- a/src/network.cpp
+++ b/src/network.cpp
@@ -233,6 +233,14 @@ void peernetwork_listen(peernetwork_t *self, const netaddr_t *listen_addr, Salti
void peernetwork_stop(peernetwork_t *self) { self->stop(); }
+void peernetwork_reg_unknown_peer_handler(peernetwork_t *self,
+ msgnetwork_unknown_peer_callback_t cb,
+ void *userdata) {
+ self->reg_unknown_peer_handler([=](const NetAddr &addr) {
+ cb(&addr, userdata);
+ });
+}
+
}
#endif