From 77fc16d21158c6542addcbaaff47b801d3b5f5c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Sat, 17 Dec 2022 20:10:20 +0100 Subject: Confirm pairing outcome after head commit --- src/network.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/network.cpp') diff --git a/src/network.cpp b/src/network.cpp index 4e802f9..8d318f7 100644 --- a/src/network.cpp +++ b/src/network.cpp @@ -703,8 +703,10 @@ void Server::Peer::updateService(ReplyBuilder & reply) for (auto & x : serviceQueue) { if (auto ref = std::get<1>(x)->check(reply)) { if (lpeer) { + Service::Context ctx { nullptr }; + server.localHead.update([&] (const Stored & local) { - Service::Context ctx(new Service::Context::Priv { + ctx = Service::Context(new Service::Context::Priv { .ref = *ref, .peer = erebos::Peer(lpeer), .local = local, @@ -719,6 +721,8 @@ void Server::Peer::updateService(ReplyBuilder & reply) return ctx.local(); }); + + ctx.runAfterCommitHooks(); } } else { next.push_back(std::move(x)); -- cgit v1.2.3