From 95ca20ba25a1c93e389eba6d058b8c813ce98a2d Mon Sep 17 00:00:00 2001 From: Kevin Heifner Date: Mon, 5 Aug 2024 07:25:50 -0500 Subject: [PATCH] GH-459 Reset sync_source when sync complete --- plugins/net_plugin/net_plugin.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/net_plugin/net_plugin.cpp b/plugins/net_plugin/net_plugin.cpp index e43ecf711f..78500de0d6 100644 --- a/plugins/net_plugin/net_plugin.cpp +++ b/plugins/net_plugin/net_plugin.cpp @@ -2215,6 +2215,7 @@ namespace eosio { auto lib = my_impl->get_chain_lib_num(); sync_last_requested_num = 0; sync_next_expected_num = std::max(sync_next_expected_num, lib + 1); + sync_source.reset(); request_next_chunk(); } } @@ -2499,6 +2500,7 @@ namespace eosio { if (blk_num >= c->sync_last_requested_block) { peer_dlog(c, "calling cancel_sync_wait, block ${b}, sync_last_requested_block ${lrb}", ("b", blk_num)("lrb", c->sync_last_requested_block)); + sync_source.reset(); c->cancel_sync_wait(); } else { peer_dlog(c, "calling sync_wait, block ${b}", ("b", blk_num));