欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

eos 源码资源限制两个对象

程序员文章站 2022-06-09 19:11:45
...

resource_usage_object 实际使用资源

struct resource_usage_object 
{
      id_type id;
      account_name owner; //< owner should not be changed within a chainbase modifier lambda
      
      usage_accumulator        net_usage;
      usage_accumulator        cpu_usage;
      uint64_t                 ram_usage = 0;
}

resource_limits_object 购买的资源

struct resource_limits_object : public chainbase::object<resource_limits_object_type, resource_limits_object> {

      OBJECT_CTOR(resource_limits_object)

      id_type id;
      account_name owner; //< owner should not be changed within a chainbase modifier lambda
      bool pending = false; //< pending should not be changed within a chainbase modifier lambda

      int64_t net_weight = -1;
      int64_t cpu_weight = -1;
      int64_t ram_bytes = -1;

   };
相关标签: 2019