提交 a28b71be 编写于 作者: A arhag

enforced minimum delay should not consider the delays of any permissions other...

enforced minimum delay should not consider the delays of any permissions other than the ones that were needed to satisfy the permissions declared in authorizations
上级 8e921b2c
......@@ -380,16 +380,15 @@ namespace eosio { namespace chain {
irrelevant_auth_exception,
"action declares irrelevant authority '${auth}'; minimum authority is ${min}",
("auth", declared_auth)("min", permission_level{min_permission.owner, min_permission.name}) );
max_delay = std::max( max_delay, *delay );
}
}
//if( should_check_signatures() ) {
if( ignore_delay )
checker.get_permission_visitor().pause_delay_tracking();
EOS_ASSERT(checker.satisfied(declared_auth), tx_missing_sigs,
"transaction declares authority '${auth}', but does not have signatures for it.",
("auth", declared_auth));
EOS_ASSERT( checker.satisfied(declared_auth), tx_missing_sigs,
"transaction declares authority '${auth}', but does not have signatures for it.",
("auth", declared_auth) );
if( ignore_delay )
checker.get_permission_visitor().resume_delay_tracking();
//}
......
......@@ -84,20 +84,18 @@ namespace detail {
return total_weight;
}
uint32_t operator()(const permission_level_weight& permission) {
if (recursion_depth < checker.recursion_depth_limit) {
checker.permission_visitor.push_undo();
checker.permission_visitor(permission.permission);
if( recursion_depth < checker.recursion_depth_limit ) {
if( checker.has_permission( permission.permission ) ) {
total_weight += permission.weight;
checker.permission_visitor.squash_undo();
// Satisfied by owner may throw off visitor expectations...
// TODO: Figure out what a permission_visitor actually needs and should expect.
} else if( checker.satisfied(permission.permission, recursion_depth + 1) ) {
total_weight += permission.weight;
checker.permission_visitor.squash_undo();
checker.permission_visitor(permission.permission);
} else {
checker.permission_visitor.pop_undo();
checker.permission_visitor.push_undo();
if( checker.satisfied(permission.permission, recursion_depth + 1) ) {
total_weight += permission.weight;
checker.permission_visitor.squash_undo();
} else {
checker.permission_visitor.pop_undo();
}
}
}
return total_weight;
......@@ -131,6 +129,7 @@ namespace detail {
}
bool satisfied(const permission_level& permission, uint16_t depth = 0) {
permission_visitor( permission );
if( has_permission( permission ) )
return true;
try {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册