From c69b0150fe0c50b91c7c8a406f096de8e9cf62fc Mon Sep 17 00:00:00 2001 From: Determinant Date: Mon, 17 Jun 2019 02:13:46 -0400 Subject: add unknown peer callback to C API --- src/network.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') 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 -- cgit v1.2.3-70-g09d2