eos 源碼資源限制兩個對象

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;

   };
發佈了20 篇原創文章 · 獲贊 4 · 訪問量 1萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章