potential fix for hung chain

This commit is contained in:
Daniel Larimer 2016-01-03 20:40:21 -05:00 committed by theoreticalbts
parent 51c10580fa
commit dd5b7708b4
4 changed files with 15 additions and 3 deletions

View file

@ -548,7 +548,10 @@ processed_transaction database::apply_transaction(const signed_transaction& trx,
processed_transaction database::_apply_transaction(const signed_transaction& trx)
{ try {
uint32_t skip = get_node_properties().skip_flags;
trx.validate();
if( !(skip&skip_validate) )
trx.validate();
auto& trx_idx = get_mutable_index_type<transaction_index>();
const chain_id_type& chain_id = get_chain_id();
auto trx_id = trx.id();

View file

@ -348,6 +348,12 @@ void database::clear_expired_orders()
assert(itr != call_index.end() && itr->debt_type() == mia_object.get_id());
asset max_settlement = max_settlement_volume - settled;
if( order.balance.amount == 0 )
{
wlog( "0 settlement detected" );
cancel_order( order );
break;
}
try {
settled += match(*itr, order, settlement_price, max_settlement);
}

View file

@ -70,7 +70,8 @@ namespace graphene { namespace chain {
skip_merkle_check = 1 << 7, ///< used while reindexing
skip_assert_evaluation = 1 << 8, ///< used while reindexing
skip_undo_history_check = 1 << 9, ///< used while reindexing
skip_witness_schedule_check = 1 << 10 ///< used whiel reindexing
skip_witness_schedule_check = 1 << 10, ///< used while reindexing
skip_validate = 1 << 11 ///< used prior to checkpoint, skips validate() call on transaction
};
/**

View file

@ -225,7 +225,9 @@ namespace graphene { namespace chain {
extensions_type extensions;
account_id_type fee_payer()const { return account; }
void validate()const {}
void validate()const {
FC_ASSERT( amount.amount > 0, "Must settle at least 1 unit" );
}
share_type calculate_fee(const fee_parameters_type& params)const
{ return 0; }