Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
YottaChain
YTBP
提交
2d093424
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,发现更多精彩内容 >>
提交
2d093424
编写于
5月 07, 2018
作者:
K
Khaled Al-Hassanieh
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Small fixes
上级
58b0d7f6
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
23 addition
and
15 deletion
+23
-15
contracts/eosio.system/eosio.system.abi
contracts/eosio.system/eosio.system.abi
+9
-4
contracts/eosio.system/eosio.system.hpp
contracts/eosio.system/eosio.system.hpp
+2
-2
contracts/eosio.system/producer_pay.cpp
contracts/eosio.system/producer_pay.cpp
+10
-7
contracts/eosio.system/voting.cpp
contracts/eosio.system/voting.cpp
+2
-2
未找到文件。
contracts/eosio.system/eosio.system.abi
浏览文件 @
2d093424
...
...
@@ -124,8 +124,13 @@
"base": "eosio_parameters",
"fields": [
{"name":"total_ram_bytes_reserved", "type":"uint64"},
{"name":"total_ram_stake", "type":"uint64"},
{"name":"payment_per_block", "type":"uint64"}
{"name":"total_ram_stake", "type":"asset"},
{"name":"last_producer_schedule_update", "type":"time"},
{"name":"last_pervote_bucket_fill", "type":"time"},
{"name":"eos_bucket", "type":"asset"},
{"name":"savings", "type":"asset"},
{"name":"last_producer_schedule_id", "type":"checksum160"},
{"name":"total_activatied_stake", "type":"int64"}
]
},{
"name": "producer_info",
...
...
@@ -182,7 +187,7 @@
{"name":"owner", "type":"account_name"},
{"name":"proxy", "type":"account_name"},
{"name":"producers", "type":"account_name[]"},
{"name":"staked", "type":"
u
int64"},
{"name":"staked", "type":"int64"},
{"name":"last_vote_weight", "type":"float64"},
{"name":"proxied_vote_weight", "type":"float64"},
{"name":"is_proxy", "type":"bool"},
...
...
contracts/eosio.system/eosio.system.hpp
浏览文件 @
2d093424
...
...
@@ -37,13 +37,13 @@ namespace eosiosystem {
eosio
::
asset
savings
;
checksum160
last_producer_schedule_id
;
int64_t
total_activ
i
ated_stake
=
0
;
int64_t
total_activated_stake
=
0
;
// explicit serialization macro is not necessary, used here only to improve compilation time
EOSLIB_SERIALIZE_DERIVED
(
eosio_global_state
,
eosio_parameters
,
(
total_ram_bytes_reserved
)(
total_ram_stake
)
(
last_producer_schedule_update
)
(
last_pervote_bucket_fill
)
(
eos_bucket
)(
savings
)(
last_producer_schedule_id
)(
total_activ
i
ated_stake
)
)
(
eos_bucket
)(
savings
)(
last_producer_schedule_id
)(
total_activated_stake
)
)
};
struct
producer_info
{
...
...
contracts/eosio.system/producer_pay.cpp
浏览文件 @
2d093424
...
...
@@ -28,16 +28,19 @@ namespace eosiosystem {
using
namespace
eosio
;
/** until activated stake crosses this threshold no new rewards are paid */
if
(
_gstate
.
total_activ
iated_stake
<
150'000'000'0000
)
if
(
_gstate
.
total_activ
ated_stake
<
150'000'000'0000
)
return
;
if
(
_gstate
.
last_pervote_bucket_fill
==
0
)
/// start the presses
_gstate
.
last_pervote_bucket_fill
=
timestamp
;
_producers
.
modify
(
_producers
.
get
(
producer
),
0
,
[
&
](
auto
&
p
)
{
auto
prod
=
_producers
.
find
(
producer
);
if
(
prod
!=
_producers
.
end
()
)
{
_producers
.
modify
(
prod
,
0
,
[
&
](
auto
&
p
)
{
p
.
produced_blocks
++
;
p
.
last_produced_block_time
=
timestamp
;
});
}
/// only update block producers once every minute, block_timestamp is in half seconds
if
(
timestamp
-
_gstate
.
last_producer_schedule_update
>
120
)
{
...
...
contracts/eosio.system/voting.cpp
浏览文件 @
2d093424
...
...
@@ -137,11 +137,11 @@ namespace eosiosystem {
/**
* The first time someone votes we calculate and set last_vote_weight, since they cannot unstake until
* after total_activ
i
ated_stake hits threshold, we can use last_vote_weight to determine that this is
* after total_activated_stake hits threshold, we can use last_vote_weight to determine that this is
* their first vote and should consider their stake activated.
*/
if
(
voter
->
last_vote_weight
<=
0.0
)
{
_gstate
.
total_activ
i
ated_stake
+=
voter
->
staked
;
_gstate
.
total_activated_stake
+=
voter
->
staked
;
}
auto
weight
=
int64_t
(
now
()
/
(
seconds_per_day
*
7
))
/
double
(
52
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录