Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
YottaChain
YTBP
提交
393546bd
Y
YTBP
项目概览
YottaChain
/
YTBP
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Y
YTBP
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
393546bd
编写于
5月 25, 2018
作者:
A
Anton Perkov
提交者:
GitHub
5月 25, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #3416 from EOSIO/eosio-buyram-fix
bugifxes: delegated bandwidth #3366, buyram from eos #3414
上级
ac5b4f34
f034af3e
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
6 addition
and
10 deletion
+6
-10
contracts/eosio.system/delegate_bandwidth.cpp
contracts/eosio.system/delegate_bandwidth.cpp
+2
-2
libraries/chain/resource_limits.cpp
libraries/chain/resource_limits.cpp
+4
-8
未找到文件。
contracts/eosio.system/delegate_bandwidth.cpp
浏览文件 @
393546bd
...
...
@@ -117,7 +117,7 @@ namespace eosiosystem {
{
payer
,
N
(
eosio
.
ram
),
quant_after_fee
,
std
::
string
(
"buy ram"
)
}
);
}
if
(
fee
.
amount
>
0
)
{
if
(
payer
!=
N
(
eosio
)
&&
fee
.
amount
>
0
)
{
INLINE_ACTION_SENDER
(
eosio
::
token
,
transfer
)(
N
(
eosio
.
token
),
{
payer
,
N
(
active
)},
{
payer
,
N
(
eosio
.
ramfee
),
fee
,
std
::
string
(
"ram fee"
)
}
);
}
...
...
@@ -259,7 +259,7 @@ namespace eosiosystem {
set_resource_limits
(
receiver
,
tot_itr
->
ram_bytes
,
tot_itr
->
net_weight
.
amount
,
tot_itr
->
cpu_weight
.
amount
);
if
(
tot_itr
->
net_weight
==
asset
(
0
)
&&
tot_itr
->
cpu_weight
==
asset
(
0
)
)
{
if
(
tot_itr
->
net_weight
==
asset
(
0
)
&&
tot_itr
->
cpu_weight
==
asset
(
0
)
&&
tot_itr
->
ram_bytes
==
0
)
{
totals_tbl
.
erase
(
tot_itr
);
}
}
// tot_itr can be invalid, should go out of scope
...
...
libraries/chain/resource_limits.cpp
浏览文件 @
393546bd
...
...
@@ -396,9 +396,8 @@ account_resource_limit resource_limits_manager::get_account_cpu_limit_ex( const
const
auto
&
state
=
_db
.
get
<
resource_limits_state_object
>
();
const
auto
&
usage
=
_db
.
get
<
resource_usage_object
,
by_owner
>
(
name
);
int64_t
x
;
int64_t
cpu_weight
;
get_account_limits
(
name
,
x
,
x
,
cpu_weight
);
int64_t
cpu_weight
,
x
,
y
;
get_account_limits
(
name
,
x
,
y
,
cpu_weight
);
if
(
cpu_weight
<
0
||
state
.
total_cpu_weight
==
0
)
{
return
{
-
1
,
-
1
,
-
1
};
...
...
@@ -412,8 +411,6 @@ account_resource_limit resource_limits_manager::get_account_cpu_limit_ex( const
uint128_t
user_weight
=
cpu_weight
;
uint128_t
all_user_weight
=
state
.
total_cpu_weight
;
wdump
((
cpu_weight
));
auto
max_user_use_in_window
=
(
uint128_t
(
virtual_cpu_capacity_in_window
)
*
user_weight
)
/
all_user_weight
;
auto
cpu_used_in_window
=
(
usage
.
cpu_usage
.
value_ex
*
window_size
)
/
config
::
rate_limiting_precision
;
...
...
@@ -460,9 +457,8 @@ account_resource_limit resource_limits_manager::get_account_net_limit_ex( const
const
auto
&
state
=
_db
.
get
<
resource_limits_state_object
>
();
const
auto
&
usage
=
_db
.
get
<
resource_usage_object
,
by_owner
>
(
name
);
int64_t
x
;
int64_t
net_weight
;
get_account_limits
(
name
,
x
,
net_weight
,
x
);
int64_t
net_weight
,
x
,
y
;
get_account_limits
(
name
,
x
,
net_weight
,
y
);
if
(
net_weight
<
0
||
state
.
total_net_weight
==
0
)
{
return
{
-
1
,
-
1
,
-
1
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录