本文整理汇总了C++中transaction_evaluation_state::get_total_out方法的典型用法代码示例。如果您正苦于以下问题:C++ transaction_evaluation_state::get_total_out方法的具体用法?C++ transaction_evaluation_state::get_total_out怎么用?C++ transaction_evaluation_state::get_total_out使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类transaction_evaluation_state
的用法示例。
在下文中一共展示了transaction_evaluation_state::get_total_out方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: on_evaluate
transaction_summary transaction_validator::on_evaluate( transaction_evaluation_state& state,
const block_evaluation_state_ptr& block_state )
{
transaction_summary sum;
state.inputs = _db->fetch_inputs( state.trx.inputs );
auto trx_delegate = _db->lookup_delegate( state.trx.vote );
FC_ASSERT( !!trx_delegate, "unable to find delegate id ${id}", ("id",state.trx.vote) );
/** make sure inputs are unique */
std::unordered_set<output_reference> unique_inputs;
for( auto in : state.trx.inputs )
{
FC_ASSERT( unique_inputs.insert( in.output_ref ).second,
"transaction references same output more than once.", ("trx",state.trx) )
}
/** validate all inputs */
for( auto in : state.inputs )
{
FC_ASSERT( !in.meta_output.is_spent(), "", ("trx",state.trx) );
validate_input( in, state, block_state );
}
/** validate all inputs */
for( auto out : state.trx.outputs )
validate_output( out, state, block_state );
state.balance_assets();
sum.valid_votes = state.valid_votes;
sum.invalid_votes = state.invalid_votes;
sum.spent = state.spent;
sum.fees = state.get_total_in(0) - state.get_total_out(0);
if( state.get_required_fees() >= 0 )
{
FC_ASSERT( sum.fees >= state.get_required_fees(0), "",
("fees",sum.fees)("required",state.get_required_fees()));
}
return sum;
}