Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
YottaChain
YTBP
提交
585b7c60
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,体验更适合开发者的 AI 搜索 >>
提交
585b7c60
编写于
6月 22, 2020
作者:
W
wangxxzhiyy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
No need to calculate the cycle profit of ecological found account
上级
8b7cad3c
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
8 addition
and
1 deletion
+8
-1
contracts/hddpool/hddpool.cpp
contracts/hddpool/hddpool.cpp
+8
-1
未找到文件。
contracts/hddpool/hddpool.cpp
浏览文件 @
585b7c60
...
...
@@ -112,7 +112,8 @@ void hddpool::calcprofit(name user)
row
.
hdd_minerhdd
=
(
int64_t
)(
profit_percent
*
(
new_balance
-
tmp_last_balance
))
+
tmp_last_balance
;
eco_inc_balance
=
new_balance
-
row
.
hdd_minerhdd
;
row
.
last_hddprofit_time
=
tmp_t
;
print
(
"{
\"
balance
\"
:"
,
it
->
hdd_minerhdd
,
"}"
);
//print("{\"balance\":", it->hdd_minerhdd, "}");
//print(new_balance, " -- ", row.hdd_minerhdd, " -- ", eco_inc_balance, "--", (int64_t)(profit_percent * (new_balance - tmp_last_balance)), "--" , tmp_last_balance);
});
...
...
@@ -130,6 +131,9 @@ void hddpool::calcprofit(name user)
void
hddpool
::
chg_owner_space
(
userhdd_index
&
userhdd
,
name
minerowner
,
uint64_t
space_delta
,
bool
is_increase
,
bool
is_calc
,
uint64_t
ct
)
{
if
(
minerowner
.
value
==
ecologyfound_acc
.
value
)
return
;
auto
userhdd_itr
=
userhdd
.
find
(
minerowner
.
value
);
eosio_assert
(
userhdd_itr
!=
userhdd
.
end
(),
"no owner exists in userhdd table"
);
int64_t
eco_inc_balance
=
0
;
...
...
@@ -142,6 +146,8 @@ void hddpool::chg_owner_space(userhdd_index& userhdd, name minerowner, uint64_t
row
.
hdd_minerhdd
=
(
int64_t
)(
profit_percent
*
(
new_balance
-
tmp_last_balance
))
+
tmp_last_balance
;
eco_inc_balance
=
new_balance
-
row
.
hdd_minerhdd
;
row
.
last_hddprofit_time
=
ct
;
//print(new_balance, " -- ", row.hdd_minerhdd, " -- ", (int64_t)(profit_percent * (new_balance - tmp_last_balance)), "--", new_balance - row.hdd_minerhdd);
}
uint64_t
newspace
=
0
;
if
(
is_increase
)
{
...
...
@@ -496,6 +502,7 @@ void hddpool::addmprofit(name owner, uint64_t minerid, uint64_t space, name call
int64_t
new_balance
=
calculate_balance
(
tmp_last_balance
,
0
,
it
->
hdd_per_cycle_profit
,
it
->
last_hdd_time
,
tmp_t
);
eosio_assert
(
is_hdd_amount_within_range
(
new_balance
),
"magnitude of miner hddbalance must be less than 2^62"
);
row
.
hdd_balance
=
(
int64_t
)(
profit_percent
*
(
new_balance
-
tmp_last_balance
))
+
tmp_last_balance
;
//print(new_balance, " -- ", row.hdd_balance, " -- ", (int64_t)(profit_percent * (new_balance - tmp_last_balance)), "--", new_balance - row.hdd_balance);
row
.
last_hdd_time
=
tmp_t
;
uint64_t
newspace
=
row
.
space
+
space
;
row
.
space
=
newspace
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录