Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
YottaChain
YTBP
提交
558ba7d7
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,发现更多精彩内容 >>
提交
558ba7d7
编写于
7月 01, 2019
作者:
W
Wang Zhi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update for testnet
上级
e2280ac0
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
24 addition
and
13 deletion
+24
-13
contracts/eosio.system/producer_pay.cpp
contracts/eosio.system/producer_pay.cpp
+5
-6
contracts/eosio.system/voting.cpp
contracts/eosio.system/voting.cpp
+8
-4
contracts/hddpool/hddpool.cpp
contracts/hddpool/hddpool.cpp
+11
-3
未找到文件。
contracts/eosio.system/producer_pay.cpp
浏览文件 @
558ba7d7
...
...
@@ -8,7 +8,7 @@ namespace eosiosystem {
//##YTA-Change start:
//Change total vote rate from 15% to 1% for test network
//const int64_t min_activated_stake = 150'000'000'0000;
const
int64_t
min_activated_stake
=
150
'000'0000
;
const
int64_t
min_activated_stake
=
5
'000'0000
;
//##YTA-Change end:
const
uint32_t
blocks_per_year
=
52
*
7
*
24
*
2
*
3600
;
// half seconds per year
const
uint32_t
seconds_per_year
=
52
*
7
*
24
*
3600
;
...
...
@@ -68,12 +68,8 @@ namespace eosiosystem {
/// only update block producers once every minute, block_timestamp is in half seconds
//if( timestamp.slot - _gstate.last_producer_schedule_update.slot > 120 ) {
/// update block producers once every two minute due to election strategy is more complex than before
if
(
timestamp
.
slot
-
_gstate
.
last_producer_schedule_update
.
slot
>
24
0
)
{
if
(
timestamp
.
slot
-
_gstate
.
last_producer_schedule_update
.
slot
>
12
0
)
{
//##YTA-Change end:
print
(
"update_elected_producers -------------------------------------
\n
"
);
print
(
"--------------------------------------------------------------
\n
"
);
print
(
"--------------------------------------------------------------
\n
"
);
print
(
"--------------------------------------------------------------
\n
"
);
update_elected_producers
(
timestamp
);
//update_elected_producers_yta( timestamp );
...
...
@@ -101,6 +97,9 @@ namespace eosiosystem {
void
system_contract
::
claimrewards
(
const
account_name
&
owner
)
{
require_auth
(
owner
);
//@@@@@@@@@@@@@@@@@@@@
return
;
const
auto
&
prod
=
_producers
.
get
(
owner
);
eosio_assert
(
prod
.
active
(),
"producer does not have an active key"
);
...
...
contracts/eosio.system/voting.cpp
浏览文件 @
558ba7d7
...
...
@@ -92,6 +92,9 @@ namespace eosiosystem {
void
system_contract
::
unregprod
(
const
account_name
producer
)
{
require_auth
(
producer
);
///@@@@@@@@@@@@@@@@@@@@@
return
;
const
auto
&
prod
=
_producers
.
get
(
producer
,
"producer not found"
);
_producers
.
modify
(
prod
,
0
,
[
&
](
producer_info
&
info
){
...
...
@@ -475,8 +478,6 @@ namespace eosiosystem {
top_producers
.
emplace_back
(
std
::
pair
<
eosio
::
producer_key
,
uint16_t
>
({{
it
->
owner
,
it
->
producer_key
},
it
->
location
})
);
}
print
(
"update_elected_producers 1 -------------------------------------
\n
"
);
print
(
"update_elected_producers top_producers.size() = "
,
top_producers
.
size
()
,
"
\n
"
);
if
(
top_producers
.
size
()
<
_gstate
.
last_producer_schedule_size
)
{
return
;
...
...
@@ -493,10 +494,8 @@ namespace eosiosystem {
bytes
packed_schedule
=
pack
(
producers
);
print
(
"update_elected_producers 2 -------------------------------------
\n
"
);
if
(
set_proposed_producers
(
packed_schedule
.
data
(),
packed_schedule
.
size
()
)
>=
0
)
{
print
(
"update_elected_producers 3 -------------------------------------
\n
"
);
_gstate
.
last_producer_schedule_size
=
static_cast
<
decltype
(
_gstate
.
last_producer_schedule_size
)
>
(
top_producers
.
size
()
);
}
}
...
...
@@ -525,6 +524,11 @@ namespace eosiosystem {
*/
void
system_contract
::
voteproducer
(
const
account_name
voter_name
,
const
account_name
proxy
,
const
std
::
vector
<
account_name
>&
producers
)
{
require_auth
(
voter_name
);
///@@@@@@@@@@@@@@@@@@@@@
eosio_assert
(
1
==
2
,
"can not vote now."
);
return
;
///@@@@@@@@@@@@@@@@@@@@
update_votes
(
voter_name
,
proxy
,
producers
,
true
);
}
...
...
contracts/hddpool/hddpool.cpp
浏览文件 @
558ba7d7
...
...
@@ -553,13 +553,21 @@ void hddpool::clearall(name owner)
{
require_auth
(
_self
);
account_name
producers
[
21
];
uint32_t
bytes_populated
=
get_active_producers
(
producers
,
sizeof
(
account_name
)
*
21
);
uint32_t
count
=
bytes_populated
/
sizeof
(
account_name
);
for
(
uint32_t
i
=
0
;
i
<
count
;
i
++
)
{
print
(
"producer -"
,
(
name
{
producers
[
i
]}),
"--
\n
"
);
}
/*
minerinfo_table _minerinfo( _self , _self );
auto itminerinfo = _minerinfo.find(863);
_minerinfo.modify(itminerinfo, _self, [&](auto &row) {
row.space_left = 50;
});
});
*/
/*
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录