当前位置: 首页>>代码示例>>C++>>正文


C++ database::head_block_num方法代码示例

本文整理汇总了C++中database::head_block_num方法的典型用法代码示例。如果您正苦于以下问题:C++ database::head_block_num方法的具体用法?C++ database::head_block_num怎么用?C++ database::head_block_num使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在database的用法示例。


在下文中一共展示了database::head_block_num方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: is_configured

bool fba_accumulator_object::is_configured( const database& db )const
{
   if( !designated_asset.valid() )
   {
      ilog( "FBA fee in block ${b} not paid because designated asset was not configured", ("b", db.head_block_num()) );
      return false;
   }
   const asset_object* dasset = db.find(*designated_asset);
   if( dasset == nullptr )
   {
      ilog( "FBA fee in block ${b} not paid because of FBA misconfiguration:  designated asset does not exist", ("b", db.head_block_num()) );
      return false;
   }
   if( dasset->is_market_issued() )
   {
      ilog( "FBA fee in block ${b} not paid because of FBA misconfiguration:  FBA is a BitAsset", ("b", db.head_block_num()) );
      return false;
   }

   const uint16_t allowed_flags = charge_market_fee;

   // check enabled issuer_permissions bits is subset of allowed_flags bits
   if( (dasset->options.issuer_permissions & allowed_flags) != dasset->options.issuer_permissions )
   {
      ilog( "FBA fee in block ${b} not paid because of FBA misconfiguration:  Disallowed permissions enabled", ("b", db.head_block_num()) );
      return false;
   }

   // check enabled issuer_permissions bits is subset of allowed_flags bits
   if( (dasset->options.flags & allowed_flags) != dasset->options.flags )
   {
      ilog( "FBA fee in block ${b} not paid because of FBA misconfiguration:  Disallowed flags enabled", ("b", db.head_block_num()) );
      return false;
   }

   if( !dasset->buyback_account.valid() )
   {
      ilog( "FBA fee in block ${b} not paid because of FBA misconfiguration:  designated asset does not have a buyback account", ("b", db.head_block_num()) );
      return false;
   }
   const account_object& issuer_acct = dasset->issuer(db);

   if( issuer_acct.owner_special_authority.which() != special_authority::tag< top_holders_special_authority >::value )
   {
      ilog( "FBA fee in block ${b} not paid because of FBA misconfiguration:  designated asset issuer has not set owner top_n control", ("b", db.head_block_num()) );
      return false;
   }
   if( issuer_acct.active_special_authority.which() != special_authority::tag< top_holders_special_authority >::value )
   {
      ilog( "FBA fee in block ${b} not paid because of FBA misconfiguration:  designated asset issuer has not set active top_n control", ("b", db.head_block_num()) );
      return false;
   }
   if( issuer_acct.owner_special_authority.get< top_holders_special_authority >().asset != *designated_asset )
   {
      ilog( "FBA fee in block ${b} not paid because of FBA misconfiguration:  designated asset issuer's top_n_control is not set to designated asset", ("b", db.head_block_num()) );
      return false;
   }
   if( issuer_acct.active_special_authority.get< top_holders_special_authority >().asset != *designated_asset )
   {
      ilog( "FBA fee in block ${b} not paid because of FBA misconfiguration:  designated asset issuer's top_n_control is not set to designated asset", ("b", db.head_block_num()) );
      return false;
   }

   if( issuer_acct.top_n_control_flags != (account_object::top_n_control_owner | account_object::top_n_control_active) )
   {
      ilog( "FBA fee in block ${b} not paid because designated asset's top_n control has not yet activated (wait until next maintenance interval)", ("b", db.head_block_num()) );
      return false;
   }

   return true;
}
开发者ID:techsharesteam,项目名称:techshares,代码行数:71,代码来源:fba_object.cpp


注:本文中的database::head_block_num方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。