Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
YottaChain
YTBP
提交
2732be06
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,发现更多精彩内容 >>
提交
2732be06
编写于
8月 28, 2018
作者:
A
arhag
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
cleanup of greylisting variables
上级
55667540
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
15 addition
and
13 deletion
+15
-13
libraries/chain/transaction_context.cpp
libraries/chain/transaction_context.cpp
+15
-13
未找到文件。
libraries/chain/transaction_context.cpp
浏览文件 @
2732be06
...
...
@@ -92,10 +92,10 @@ namespace eosio { namespace chain {
// Calculate the highest network usage and CPU time that all of the billed accounts can afford to be billed
int64_t
account_net_limit
=
0
;
int64_t
account_cpu_limit
=
0
;
bool
greylisted
=
false
,
greylistedCPU
=
false
;
std
::
tie
(
account_net_limit
,
account_cpu_limit
,
greylisted
,
greylistedCPU
)
=
max_bandwidth_billed_accounts_can_pay
();
net_limit_due_to_greylist
|=
greylisted
;
cpu_limit_due_to_greylist
|=
greylisted
CPU
;
bool
greylisted
_net
=
false
,
greylisted_cpu
=
false
;
std
::
tie
(
account_net_limit
,
account_cpu_limit
,
greylisted
_net
,
greylisted_cpu
)
=
max_bandwidth_billed_accounts_can_pay
();
net_limit_due_to_greylist
|=
greylisted
_net
;
cpu_limit_due_to_greylist
|=
greylisted
_cpu
;
eager_net_limit
=
net_limit
;
...
...
@@ -225,19 +225,21 @@ namespace eosio { namespace chain {
// Calculate the new highest network usage and CPU time that all of the billed accounts can afford to be billed
int64_t
account_net_limit
=
0
;
int64_t
account_cpu_limit
=
0
;
bool
greylisted
=
false
,
greylistedCPU
=
false
;
std
::
tie
(
account_net_limit
,
account_cpu_limit
,
greylisted
,
greylistedCPU
)
=
max_bandwidth_billed_accounts_can_pay
();
net_limit_due_to_greylist
|=
greylisted
;
cpu_limit_due_to_greylist
|=
greylisted
CPU
;
bool
greylisted
_net
=
false
,
greylisted_cpu
=
false
;
std
::
tie
(
account_net_limit
,
account_cpu_limit
,
greylisted
_net
,
greylisted_cpu
)
=
max_bandwidth_billed_accounts_can_pay
();
net_limit_due_to_greylist
|=
greylisted
_net
;
cpu_limit_due_to_greylist
|=
greylisted
_cpu
;
// Possibly lower net_limit to what the billed accounts can pay
if
(
static_cast
<
uint64_t
>
(
account_net_limit
)
<=
net_limit
)
{
// NOTE: net_limit may possibly not be objective anymore due to net greylisting, but it should still be no greater than the truly objective net_limit
net_limit
=
static_cast
<
uint64_t
>
(
account_net_limit
);
net_limit_due_to_block
=
false
;
}
// Possibly lower objective_duration_limit to what the billed accounts can pay
if
(
account_cpu_limit
<=
objective_duration_limit
.
count
()
)
{
// NOTE: objective_duration_limit may possibly not be objective anymore due to cpu greylisting, but it should still be no greater than the truly objective objective_duration_limit
objective_duration_limit
=
fc
::
microseconds
(
account_cpu_limit
);
billing_timer_exception_code
=
tx_cpu_usage_exceeded
::
code_value
;
}
...
...
@@ -400,23 +402,23 @@ namespace eosio { namespace chain {
const
static
int64_t
large_number_no_overflow
=
std
::
numeric_limits
<
int64_t
>::
max
()
/
2
;
int64_t
account_net_limit
=
large_number_no_overflow
;
int64_t
account_cpu_limit
=
large_number_no_overflow
;
bool
greylisted
=
false
;
bool
greylisted
CPU
=
false
;
bool
greylisted
_net
=
false
;
bool
greylisted
_cpu
=
false
;
for
(
const
auto
&
a
:
bill_to_accounts
)
{
bool
elastic
=
force_elastic_limits
||
!
(
control
.
is_producing_block
()
&&
control
.
is_resource_greylisted
(
a
));
auto
net_limit
=
rl
.
get_account_net_limit
(
a
,
elastic
);
if
(
net_limit
>=
0
)
{
account_net_limit
=
std
::
min
(
account_net_limit
,
net_limit
);
if
(
!
elastic
)
greylisted
=
true
;
if
(
!
elastic
)
greylisted
_net
=
true
;
}
auto
cpu_limit
=
rl
.
get_account_cpu_limit
(
a
,
elastic
);
if
(
cpu_limit
>=
0
)
{
account_cpu_limit
=
std
::
min
(
account_cpu_limit
,
cpu_limit
);
if
(
!
elastic
)
greylisted
CPU
=
true
;
if
(
!
elastic
)
greylisted
_cpu
=
true
;
}
}
return
std
::
make_tuple
(
account_net_limit
,
account_cpu_limit
,
greylisted
,
greylistedCPU
);
return
std
::
make_tuple
(
account_net_limit
,
account_cpu_limit
,
greylisted
_net
,
greylisted_cpu
);
}
void
transaction_context
::
dispatch_action
(
action_trace
&
trace
,
const
action
&
a
,
account_name
receiver
,
bool
context_free
,
uint32_t
recurse_depth
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录