From 2dedebdca80c2f954ee815d1e25cf3f8fc695cc7 Mon Sep 17 00:00:00 2001 From: theoreticalbts Date: Tue, 1 Sep 2015 16:11:58 -0400 Subject: [PATCH] witness.cpp: Don't filter witnesses prematurely If invalid witness ID's or keys are specified in the config file, we simply don't produce until they become valid. --- libraries/plugins/witness/witness.cpp | 41 --------------------------- 1 file changed, 41 deletions(-) diff --git a/libraries/plugins/witness/witness.cpp b/libraries/plugins/witness/witness.cpp index c638da87..f86e0d97 100644 --- a/libraries/plugins/witness/witness.cpp +++ b/libraries/plugins/witness/witness.cpp @@ -116,49 +116,8 @@ void witness_plugin::plugin_startup() { try { ilog("witness plugin: plugin_startup() begin"); chain::database& d = database(); - std::set bad_wits; //Start NTP time client graphene::time::now(); - for( auto wit : _witnesses ) - { - if( d.find(wit) == nullptr ) - { - if( app().is_finished_syncing() ) - { - elog("ERROR: Unable to find witness ${w}, even though syncing has finished. This witness will be ignored.", - ("w", wit)); - continue; - } else { - wlog("WARNING: Unable to find witness ${w}. Postponing initialization until syncing finishes.", - ("w", wit)); - app().syncing_finished.connect([this]{plugin_startup();}); - return; - } - } - - auto signing_key = wit(d).signing_key; - if( !_private_keys.count(signing_key) ) - { - // Check if it's a duplicate key of one I do have - bool found_duplicate = false; - for( const auto& private_key : _private_keys ) - if( chain::public_key_type(private_key.second.get_public_key()) == signing_key ) - { - ilog("Found duplicate key: ${k1} matches ${k2}; using this key to sign for ${w}", - ("k1", private_key.first)("k2", signing_key)("w", wit)); - _private_keys[signing_key] = private_key.second; - found_duplicate = true; - break; - } - if( found_duplicate ) - continue; - - elog("Unable to find key for witness ${w}. Removing it from my witnesses.", ("w", wit)); - bad_wits.insert(wit); - } - } - for( auto wit : bad_wits ) - _witnesses.erase(wit); if( !_witnesses.empty() ) {