From 2a105b55d8de1e2b34e8fd9f3ca81eb633824975 Mon Sep 17 00:00:00 2001 From: CooDi Date: Fri, 15 Feb 2019 11:48:13 +0300 Subject: [PATCH] fix blockid in state --- uos_blocks_exporter/uos_blocks_exporter.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/uos_blocks_exporter/uos_blocks_exporter.cpp b/uos_blocks_exporter/uos_blocks_exporter.cpp index 2bd1475..57b3ffd 100644 --- a/uos_blocks_exporter/uos_blocks_exporter.cpp +++ b/uos_blocks_exporter/uos_blocks_exporter.cpp @@ -88,10 +88,11 @@ namespace uos_plugins{ void uos_BE_impl::applied_transaction_catcher(const eosio::chain::transaction_trace_ptr &att) { fc::variants actions; try{ - fc::variant temp = att->producer_block_id; - last_state.mongo_blockid = temp.as_string(); - last_state.mongo_blocknum = att->block_num; - mongo->set_last_state(last_state); + if(att->producer_block_id) { + last_state.mongo_blockid = fc::variant(att->producer_block_id).as_string(); + last_state.mongo_blocknum = att->block_num; + mongo->set_last_state(last_state); + } } catch (mongocxx::exception &ex){ elog(ex.what());