From 58fee31769d7e4a6b1212fb1eb1367bbdc0c1bbb Mon Sep 17 00:00:00 2001 From: Kevin Heifner Date: Wed, 18 Sep 2019 16:00:55 -0400 Subject: [PATCH] get_block_id_for_num will throw unknown_block_exception when block num is not found --- plugins/net_plugin/net_plugin.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/net_plugin/net_plugin.cpp b/plugins/net_plugin/net_plugin.cpp index 47086502a1c..48cead04431 100644 --- a/plugins/net_plugin/net_plugin.cpp +++ b/plugins/net_plugin/net_plugin.cpp @@ -1502,7 +1502,11 @@ namespace eosio { c->enqueue( note ); } c->syncing = true; - if( cc.get_block_id_for_num( msg.head_num ) != msg.head_id ) { + bool on_fork = true; + try { + on_fork = cc.get_block_id_for_num( msg.head_num ) != msg.head_id; + } catch( ... ) {} + if( on_fork ) { request_message req; req.req_blocks.mode = catch_up; req.req_trx.mode = none;