fix derefrence of null, fix build, restore compat with oct5 test net
This commit is contained in:
parent
be7c0076d0
commit
eb1895ef55
3 changed files with 12 additions and 8 deletions
|
|
@ -640,8 +640,11 @@ const witness_object& database::validate_block_header( uint32_t skip, const sign
|
|||
|
||||
witness_id_type scheduled_witness = get_scheduled_witness( slot_num );
|
||||
|
||||
FC_ASSERT( next_block.witness == scheduled_witness, "Witness produced block at wrong time",
|
||||
("block witness",next_block.witness)("scheduled",scheduled_witness)("slot_num",slot_num) );
|
||||
#warning remove this hardfork check for next release
|
||||
if( next_block.block_num() > 58500 ) {
|
||||
FC_ASSERT( next_block.witness == scheduled_witness, "Witness produced block at wrong time",
|
||||
("block witness",next_block.witness)("scheduled",scheduled_witness)("slot_num",slot_num) );
|
||||
}
|
||||
}
|
||||
|
||||
return witness;
|
||||
|
|
|
|||
|
|
@ -47,7 +47,8 @@ vector<std::reference_wrapper<const typename Index::object_type>> database::sort
|
|||
template<class... Types>
|
||||
void database::perform_account_maintenance(std::tuple<Types...> helpers)
|
||||
{
|
||||
const auto& idx = get_index_type<account_index>().indices().get<by_name>();
|
||||
#warning switch to this for next release: const auto& idx = get_index_type<account_index>().indices().get<by_name>();
|
||||
const auto& idx = get_index_type<account_index>().indices();
|
||||
for( const account_object& a : idx )
|
||||
detail::for_each(helpers, a, detail::gen_seq<sizeof...(Types)>());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -216,24 +216,24 @@ void_result call_order_update_evaluator::do_apply(const call_order_update_operat
|
|||
// then we must check for margin calls and other issues
|
||||
if( !_bitasset_data->is_prediction_market )
|
||||
{
|
||||
auto call_order_id = call_obj->id;
|
||||
call_order_id_type call_order_id = call_obj->id;
|
||||
|
||||
// check to see if the order needs to be margin called now, but don't allow black swans and require there to be
|
||||
// limit orders available that could be used to fill the order.
|
||||
if( d.check_call_orders( *_debt_asset, false ) )
|
||||
{
|
||||
auto call_obj = find_object(call_order_id);
|
||||
const auto call_obj = d.find(call_order_id);
|
||||
// if we filled at least one call order, we are OK if we totally filled.
|
||||
GRAPHENE_ASSERT(
|
||||
!d.find_object( call_order_id ),
|
||||
call_order_update_unfilled_margin_call,
|
||||
"Updating call order would trigger a margin call that cannot be fully filled",
|
||||
("a", call_obj ? ~call_obj->call_price : "NULL")("b", _bitasset_data->current_feed.settlement_price)
|
||||
("a", call_obj ? ~call_obj->call_price : price())("b", _bitasset_data->current_feed.settlement_price)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
auto call_obj = find_object(call_order_id);
|
||||
const auto call_obj = d.find(call_order_id);
|
||||
//edump( (~call_obj->call_price) ("<")( _bitasset_data->current_feed.settlement_price) );
|
||||
// We didn't fill any call orders. This may be because we
|
||||
// aren't in margin call territory, or it may be because there
|
||||
|
|
@ -242,7 +242,7 @@ void_result call_order_update_evaluator::do_apply(const call_order_update_operat
|
|||
~call_obj->call_price < _bitasset_data->current_feed.settlement_price,
|
||||
call_order_update_unfilled_margin_call,
|
||||
"Updating call order would trigger a margin call that cannot be fully filled",
|
||||
("a",call_obj ? ~call_obj->call_price : "NULL")("b", _bitasset_data->current_feed.settlement_price)
|
||||
("a",call_obj ? ~call_obj->call_price : price())("b", _bitasset_data->current_feed.settlement_price)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue