Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
plugin
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
link33
plugin
Commits
ebdac31a
Commit
ebdac31a
authored
Nov 09, 2020
by
madengji
Committed by
vipwzw
Nov 11, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decimal config
parent
e04c4a42
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
5 deletions
+19
-5
chain33.para.toml
chain33.para.toml
+2
-1
action.go
plugin/dapp/paracross/executor/action.go
+6
-1
reward.go
plugin/dapp/paracross/executor/reward.go
+11
-3
No files found.
chain33.para.toml
View file @
ebdac31a
...
...
@@ -94,7 +94,8 @@ coinDevFund=12
coinBaseReward
=
3
#委托账户最少解绑定时间(按小时)
unBindTime
=
24
#支持挖矿奖励的1e8小数模式,比如18coin 需要配置成1800000000 以支持小数位后的配置
#decimalMode=true
[consensus.sub.para]
#主链节点的grpc服务器ip,当前可以支持多ip负载均衡,如“118.31.177.1:8802,39.97.2.127:8802”
...
...
plugin/dapp/paracross/executor/action.go
View file @
ebdac31a
...
...
@@ -1300,12 +1300,17 @@ func (a *action) Miner(miner *pt.ParacrossMinerAction) (*types.Receipt, error) {
}
totalReward
*=
types
.
Coin
decimalMode
:=
cfg
.
MIsEnable
(
"mver.consensus.paracross.decimalMode"
,
a
.
height
)
if
!
decimalMode
{
totalReward
*=
types
.
Coin
}
if
totalReward
>
0
{
issueReceipt
,
err
:=
a
.
coinsAccount
.
ExecIssueCoins
(
a
.
execaddr
,
totalReward
)
if
err
!=
nil
{
clog
.
Error
(
"paracross miner issue err"
,
"height"
,
miner
.
Status
.
Height
,
"execAddr"
,
a
.
execaddr
,
"amount"
,
totalReward
/
types
.
Coin
)
"execAddr"
,
a
.
execaddr
,
"amount"
,
totalReward
)
return
nil
,
err
}
minerReceipt
=
mergeReceipt
(
minerReceipt
,
issueReceipt
)
...
...
plugin/dapp/paracross/executor/reward.go
View file @
ebdac31a
...
...
@@ -107,9 +107,17 @@ func (a *action) rewardBindAddr(coinReward int64, bindList *pt.ParaNodeBindList,
func
(
a
*
action
)
reward
(
nodeStatus
*
pt
.
ParacrossNodeStatus
,
stat
*
pt
.
ParacrossHeightStatus
)
(
*
types
.
Receipt
,
error
)
{
//获取挖矿相关配置,这里需注意是共识的高度,而不是交易的高度
cfg
:=
a
.
api
.
GetConfig
()
coinReward
:=
cfg
.
MGInt
(
"mver.consensus.paracross.coinReward"
,
nodeStatus
.
Height
)
*
types
.
Coin
coinBaseReward
:=
cfg
.
MGInt
(
"mver.consensus.paracross.coinBaseReward"
,
nodeStatus
.
Height
)
*
types
.
Coin
fundReward
:=
cfg
.
MGInt
(
"mver.consensus.paracross.coinDevFund"
,
nodeStatus
.
Height
)
*
types
.
Coin
coinReward
:=
cfg
.
MGInt
(
"mver.consensus.paracross.coinReward"
,
nodeStatus
.
Height
)
fundReward
:=
cfg
.
MGInt
(
"mver.consensus.paracross.coinDevFund"
,
nodeStatus
.
Height
)
coinBaseReward
:=
cfg
.
MGInt
(
"mver.consensus.paracross.coinBaseReward"
,
nodeStatus
.
Height
)
decimalMode
:=
cfg
.
MIsEnable
(
"mver.consensus.paracross.decimalMode"
,
nodeStatus
.
Height
)
if
!
decimalMode
{
coinReward
*=
types
.
Coin
fundReward
*=
types
.
Coin
coinBaseReward
*=
types
.
Coin
}
fundAddr
:=
cfg
.
MGStr
(
"mver.consensus.fundKeyAddr"
,
nodeStatus
.
Height
)
//防止coinBaseReward 设置出错场景, coinBaseReward 一定要比coinReward小
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment