witness.cpp: Set skip_undo_history_check when --enable-stale-production is specified
This commit is contained in:
parent
0b6f7fe430
commit
e1530709d9
2 changed files with 8 additions and 3 deletions
|
|
@ -75,6 +75,7 @@ private:
|
||||||
bool _production_enabled = false;
|
bool _production_enabled = false;
|
||||||
bool _consecutive_production_enabled = false;
|
bool _consecutive_production_enabled = false;
|
||||||
uint32_t _required_witness_participation = 33 * GRAPHENE_1_PERCENT;
|
uint32_t _required_witness_participation = 33 * GRAPHENE_1_PERCENT;
|
||||||
|
uint32_t _production_skip_flags = graphene::chain::database::skip_nothing;
|
||||||
|
|
||||||
std::map<chain::public_key_type, fc::ecc::private_key> _private_keys;
|
std::map<chain::public_key_type, fc::ecc::private_key> _private_keys;
|
||||||
std::set<chain::witness_id_type> _witnesses;
|
std::set<chain::witness_id_type> _witnesses;
|
||||||
|
|
|
||||||
|
|
@ -123,8 +123,12 @@ void witness_plugin::plugin_startup()
|
||||||
{
|
{
|
||||||
ilog("Launching block production for ${n} witnesses.", ("n", _witnesses.size()));
|
ilog("Launching block production for ${n} witnesses.", ("n", _witnesses.size()));
|
||||||
app().set_block_production(true);
|
app().set_block_production(true);
|
||||||
if( _production_enabled && (d.head_block_num() == 0) )
|
if( _production_enabled )
|
||||||
new_chain_banner(d);
|
{
|
||||||
|
if( d.head_block_num() == 0 )
|
||||||
|
new_chain_banner(d);
|
||||||
|
_production_skip_flags |= graphene::chain::database::skip_undo_history_check;
|
||||||
|
}
|
||||||
schedule_production_loop();
|
schedule_production_loop();
|
||||||
} else
|
} else
|
||||||
elog("No witnesses configured! Please add witness IDs and private keys to configuration.");
|
elog("No witnesses configured! Please add witness IDs and private keys to configuration.");
|
||||||
|
|
@ -278,7 +282,7 @@ block_production_condition::block_production_condition_enum witness_plugin::mayb
|
||||||
scheduled_time,
|
scheduled_time,
|
||||||
scheduled_witness,
|
scheduled_witness,
|
||||||
private_key_itr->second,
|
private_key_itr->second,
|
||||||
graphene::chain::database::skip_nothing
|
_production_skip_flags
|
||||||
);
|
);
|
||||||
capture("n", block.block_num())("t", block.timestamp)("c", now);
|
capture("n", block.block_num())("t", block.timestamp)("c", now);
|
||||||
p2p_node().broadcast(net::block_message(block));
|
p2p_node().broadcast(net::block_message(block));
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue