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
1c51e32d
Commit
1c51e32d
authored
May 23, 2019
by
kingwang
Committed by
33cn
May 24, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update 05/23
parent
df09995f
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
72 additions
and
727 deletions
+72
-727
mock_blockchain_test.go
...or/github.com/33cn/chain33/client/mock_blockchain_test.go
+1
-5
http.go
vendor/github.com/33cn/chain33/rpc/http.go
+5
-7
coins.go
vendor/github.com/33cn/chain33/system/dapp/commands/coins.go
+1
-1
stat.go
vendor/github.com/33cn/chain33/system/dapp/commands/stat.go
+1
-442
types.go
...thub.com/33cn/chain33/system/dapp/commands/types/types.go
+0
-20
register.go
vendor/github.com/33cn/chain33/system/dapp/register.go
+14
-6
fork.go
vendor/github.com/33cn/chain33/types/fork.go
+2
-0
statistic.proto
vendor/github.com/33cn/chain33/types/proto/statistic.proto
+0
-27
statistic.pb.go
vendor/github.com/33cn/chain33/types/statistic.pb.go
+34
-214
guodun.toml
vendor/github.com/33cn/chain33/types/testdata/guodun.toml
+1
-0
local.mvertest.toml
...ithub.com/33cn/chain33/types/testdata/local.mvertest.toml
+1
-0
tx.go
vendor/github.com/33cn/chain33/types/tx.go
+12
-5
No files found.
vendor/github.com/33cn/chain33/client/mock_blockchain_test.go
View file @
1c51e32d
...
@@ -129,12 +129,8 @@ func (m *mockBlockChain) SetQueueClient(q queue.Queue) {
...
@@ -129,12 +129,8 @@ func (m *mockBlockChain) SetQueueClient(q queue.Queue) {
msg
.
ReplyErr
(
"Do not support"
,
types
.
ErrInvalidParam
)
msg
.
ReplyErr
(
"Do not support"
,
types
.
ErrInvalidParam
)
}
}
case
types
.
EventLocalList
:
case
types
.
EventLocalList
:
if
req
,
ok
:=
msg
.
GetData
()
.
(
*
types
.
LocalDBList
);
ok
{
if
_
,
ok
:=
msg
.
GetData
()
.
(
*
types
.
LocalDBList
);
ok
{
if
len
(
req
.
Key
)
>
0
&&
bytes
.
Equal
(
req
.
Key
,
[]
byte
(
"Statistics:TicketInfoOrder:Addr:case1"
))
{
msg
.
Reply
(
client
.
NewMessage
(
blockchainKey
,
types
.
EventReplyQuery
,
&
types
.
TicketMinerInfo
{}))
}
else
{
msg
.
Reply
(
client
.
NewMessage
(
blockchainKey
,
types
.
EventReplyQuery
,
&
types
.
LocalReplyValue
{}))
msg
.
Reply
(
client
.
NewMessage
(
blockchainKey
,
types
.
EventReplyQuery
,
&
types
.
LocalReplyValue
{}))
}
}
else
{
}
else
{
msg
.
ReplyErr
(
"Do not support"
,
types
.
ErrInvalidParam
)
msg
.
ReplyErr
(
"Do not support"
,
types
.
ErrInvalidParam
)
}
}
...
...
vendor/github.com/33cn/chain33/rpc/http.go
View file @
1c51e32d
...
@@ -76,17 +76,15 @@ func (j *JSONRPCServer) Listen() (int, error) {
...
@@ -76,17 +76,15 @@ func (j *JSONRPCServer) Listen() (int, error) {
}
}
//格式做一个检查
//格式做一个检查
client
,
err
:=
parseJSONRpcParams
(
data
)
client
,
err
:=
parseJSONRpcParams
(
data
)
errstr
:=
"nil"
if
err
!=
nil
{
if
err
!=
nil
{
errstr
=
err
.
Error
()
err
=
fmt
.
Errorf
(
`invalid json request err:%s`
,
err
.
Error
())
log
.
Debug
(
"JSONRPCServer"
,
"request"
,
string
(
data
),
"parseErr"
,
err
)
writeError
(
w
,
r
,
0
,
err
.
Error
())
return
}
}
funcName
:=
strings
.
Split
(
client
.
Method
,
"."
)[
len
(
strings
.
Split
(
client
.
Method
,
"."
))
-
1
]
funcName
:=
strings
.
Split
(
client
.
Method
,
"."
)[
len
(
strings
.
Split
(
client
.
Method
,
"."
))
-
1
]
if
!
checkFilterPrintFuncBlacklist
(
funcName
)
{
if
!
checkFilterPrintFuncBlacklist
(
funcName
)
{
log
.
Debug
(
"JSONRPCServer"
,
"request"
,
string
(
data
),
"err"
,
errstr
)
log
.
Debug
(
"JSONRPCServer"
,
"request"
,
string
(
data
))
}
if
err
!=
nil
{
writeError
(
w
,
r
,
0
,
fmt
.
Sprintf
(
`parse request err %s`
,
err
.
Error
()))
return
}
}
//Release local request
//Release local request
ipaddr
:=
net
.
ParseIP
(
ip
)
ipaddr
:=
net
.
ParseIP
(
ip
)
...
...
vendor/github.com/33cn/chain33/system/dapp/commands/coins.go
View file @
1c51e32d
...
@@ -215,7 +215,7 @@ func createTxGroup(cmd *cobra.Command, args []string) {
...
@@ -215,7 +215,7 @@ func createTxGroup(cmd *cobra.Command, args []string) {
fmt
.
Fprintln
(
os
.
Stderr
,
err
)
fmt
.
Fprintln
(
os
.
Stderr
,
err
)
return
return
}
}
err
=
group
.
Check
(
0
,
types
.
GInt
(
"MinFee"
),
types
.
GInt
(
"MaxFee"
))
err
=
group
.
Check
WithFork
(
true
,
true
,
0
,
types
.
GInt
(
"MinFee"
),
types
.
GInt
(
"MaxFee"
))
if
err
!=
nil
{
if
err
!=
nil
{
fmt
.
Fprintln
(
os
.
Stderr
,
err
)
fmt
.
Fprintln
(
os
.
Stderr
,
err
)
return
return
...
...
vendor/github.com/33cn/chain33/system/dapp/commands/stat.go
View file @
1c51e32d
...
@@ -9,15 +9,9 @@ import (
...
@@ -9,15 +9,9 @@ import (
"fmt"
"fmt"
"os"
"os"
"strconv"
"strconv"
"time"
"github.com/33cn/chain33/common/address"
"github.com/33cn/chain33/rpc/jsonclient"
"math/big"
"github.com/33cn/chain33/common"
"github.com/33cn/chain33/common"
"github.com/33cn/chain33/
common/difficulty
"
"github.com/33cn/chain33/
rpc/jsonclient
"
rpctypes
"github.com/33cn/chain33/rpc/types"
rpctypes
"github.com/33cn/chain33/rpc/types"
commandtypes
"github.com/33cn/chain33/system/dapp/commands/types"
commandtypes
"github.com/33cn/chain33/system/dapp/commands/types"
"github.com/33cn/chain33/types"
"github.com/33cn/chain33/types"
...
@@ -34,10 +28,6 @@ func StatCmd() *cobra.Command {
...
@@ -34,10 +28,6 @@ func StatCmd() *cobra.Command {
cmd
.
AddCommand
(
cmd
.
AddCommand
(
GetTotalCoinsCmd
(),
GetTotalCoinsCmd
(),
GetTicketStatCmd
(),
GetTicketInfoCmd
(),
GetTicketInfoListCmd
(),
GetMinerStatCmd
(),
GetExecBalanceCmd
(),
GetExecBalanceCmd
(),
)
)
...
@@ -213,437 +203,6 @@ func totalCoins(cmd *cobra.Command, args []string) {
...
@@ -213,437 +203,6 @@ func totalCoins(cmd *cobra.Command, args []string) {
fmt
.
Println
(
string
(
data
))
fmt
.
Println
(
string
(
data
))
}
}
// GetTicketStatCmd get ticket stat
func
GetTicketStatCmd
()
*
cobra
.
Command
{
cmd
:=
&
cobra
.
Command
{
Use
:
"ticket_stat"
,
Short
:
"Get ticket statistics by addr"
,
Run
:
ticketStat
,
}
addTicketStatCmdFlags
(
cmd
)
return
cmd
}
func
addTicketStatCmdFlags
(
cmd
*
cobra
.
Command
)
{
cmd
.
Flags
()
.
StringP
(
"addr"
,
"a"
,
""
,
"addr"
)
cmd
.
MarkFlagRequired
(
"addr"
)
}
func
ticketStat
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
rpcAddr
,
_
:=
cmd
.
Flags
()
.
GetString
(
"rpc_laddr"
)
addr
,
_
:=
cmd
.
Flags
()
.
GetString
(
"addr"
)
rpc
,
err
:=
jsonclient
.
NewJSONClient
(
rpcAddr
)
if
err
!=
nil
{
fmt
.
Fprintln
(
os
.
Stderr
,
err
)
return
}
key
:=
[]
byte
(
"Statistics:TicketStat:Addr:"
+
addr
)
fmt
.
Println
(
string
(
key
))
params
:=
types
.
LocalDBGet
{
Keys
:
[][]
byte
{
key
}}
var
res
types
.
TicketStatistic
err
=
rpc
.
Call
(
"Chain33.QueryTicketStat"
,
params
,
&
res
)
if
err
!=
nil
{
fmt
.
Fprintln
(
os
.
Stderr
,
err
)
return
}
var
resp
commandtypes
.
GetTicketStatisticResult
resp
.
CurrentOpenCount
=
res
.
CurrentOpenCount
resp
.
TotalMinerCount
=
res
.
TotalMinerCount
resp
.
TotalCloseCount
=
res
.
TotalCancleCount
data
,
err
:=
json
.
MarshalIndent
(
resp
,
""
,
" "
)
if
err
!=
nil
{
fmt
.
Fprintln
(
os
.
Stderr
,
err
)
return
}
fmt
.
Println
(
string
(
data
))
}
// GetTicketInfoCmd get a ticket information
func
GetTicketInfoCmd
()
*
cobra
.
Command
{
cmd
:=
&
cobra
.
Command
{
Use
:
"ticket_info"
,
Short
:
"Get ticket info by ticket_id"
,
Run
:
ticketInfo
,
}
addTicketInfoCmdFlags
(
cmd
)
return
cmd
}
func
addTicketInfoCmdFlags
(
cmd
*
cobra
.
Command
)
{
cmd
.
Flags
()
.
StringP
(
"ticket_id"
,
"t"
,
""
,
"ticket_id"
)
cmd
.
MarkFlagRequired
(
"ticket_id"
)
}
func
ticketInfo
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
rpcAddr
,
_
:=
cmd
.
Flags
()
.
GetString
(
"rpc_laddr"
)
ticketID
,
_
:=
cmd
.
Flags
()
.
GetString
(
"ticket_id"
)
rpc
,
err
:=
jsonclient
.
NewJSONClient
(
rpcAddr
)
if
err
!=
nil
{
fmt
.
Fprintln
(
os
.
Stderr
,
err
)
return
}
key
:=
[]
byte
(
"Statistics:TicketInfo:TicketId:"
+
ticketID
)
fmt
.
Println
(
string
(
key
))
params
:=
types
.
LocalDBGet
{
Keys
:
[][]
byte
{
key
}}
var
res
types
.
TicketMinerInfo
err
=
rpc
.
Call
(
"Chain33.QueryTicketInfo"
,
params
,
&
res
)
if
err
!=
nil
{
fmt
.
Fprintln
(
os
.
Stderr
,
err
)
return
}
var
resp
commandtypes
.
GetTicketMinerInfoResult
resp
.
TicketID
=
res
.
TicketId
switch
res
.
Status
{
case
1
:
resp
.
Status
=
"openTicket"
case
2
:
resp
.
Status
=
"minerTicket"
case
3
:
resp
.
Status
=
"closeTicket"
}
switch
res
.
PrevStatus
{
case
1
:
resp
.
PrevStatus
=
"openTicket"
case
2
:
resp
.
PrevStatus
=
"minerTicket"
case
3
:
resp
.
PrevStatus
=
"closeTicket"
}
resp
.
IsGenesis
=
res
.
IsGenesis
resp
.
CreateTime
=
time
.
Unix
(
res
.
CreateTime
,
0
)
.
Format
(
"20060102150405"
)
resp
.
MinerTime
=
time
.
Unix
(
res
.
MinerTime
,
0
)
.
Format
(
"20060102150405"
)
resp
.
CloseTime
=
time
.
Unix
(
res
.
CloseTime
,
0
)
.
Format
(
"20060102150405"
)
resp
.
MinerValue
=
res
.
MinerValue
resp
.
MinerAddress
=
res
.
MinerAddress
data
,
err
:=
json
.
MarshalIndent
(
resp
,
""
,
" "
)
if
err
!=
nil
{
fmt
.
Fprintln
(
os
.
Stderr
,
err
)
return
}
fmt
.
Println
(
string
(
data
))
}
// GetTicketInfoListCmd get ticket information list
func
GetTicketInfoListCmd
()
*
cobra
.
Command
{
cmd
:=
&
cobra
.
Command
{
Use
:
"ticket_info_list"
,
Short
:
"Get ticket info list by ticket_id"
,
Run
:
ticketInfoList
,
}
addTicketInfoListCmdFlags
(
cmd
)
return
cmd
}
func
addTicketInfoListCmdFlags
(
cmd
*
cobra
.
Command
)
{
cmd
.
Flags
()
.
StringP
(
"addr"
,
"a"
,
""
,
"addr"
)
cmd
.
MarkFlagRequired
(
"addr"
)
cmd
.
Flags
()
.
Int32P
(
"count"
,
"c"
,
10
,
"count"
)
//cmd.MarkFlagRequired("count")
cmd
.
Flags
()
.
Int32P
(
"direction"
,
"d"
,
1
,
"query direction (0: pre page, 1: next page)"
)
cmd
.
Flags
()
.
StringP
(
"create_time"
,
"r"
,
""
,
"create_time"
)
cmd
.
Flags
()
.
StringP
(
"ticket_id"
,
"t"
,
""
,
"ticket_id"
)
}
func
ticketInfoList
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
rpcAddr
,
_
:=
cmd
.
Flags
()
.
GetString
(
"rpc_laddr"
)
addr
,
_
:=
cmd
.
Flags
()
.
GetString
(
"addr"
)
count
,
_
:=
cmd
.
Flags
()
.
GetInt32
(
"count"
)
direction
,
_
:=
cmd
.
Flags
()
.
GetInt32
(
"direction"
)
createTime
,
_
:=
cmd
.
Flags
()
.
GetString
(
"create_time"
)
ticketID
,
_
:=
cmd
.
Flags
()
.
GetString
(
"ticket_id"
)
if
count
<=
0
{
fmt
.
Fprintln
(
os
.
Stderr
,
fmt
.
Errorf
(
"input err, count:%v"
,
count
))
return
}
rpc
,
err
:=
jsonclient
.
NewJSONClient
(
rpcAddr
)
if
err
!=
nil
{
fmt
.
Fprintln
(
os
.
Stderr
,
err
)
return
}
var
key
[]
byte
prefix
:=
[]
byte
(
"Statistics:TicketInfoOrder:Addr:"
+
addr
)
if
ticketID
!=
""
&&
createTime
!=
""
{
key
=
[]
byte
(
"Statistics:TicketInfoOrder:Addr:"
+
addr
+
":CreateTime:"
+
createTime
+
":TicketId:"
+
ticketID
)
}
fmt
.
Println
(
string
(
prefix
))
fmt
.
Println
(
string
(
key
))
params
:=
types
.
LocalDBList
{
Prefix
:
prefix
,
Key
:
key
,
Direction
:
direction
,
Count
:
count
}
var
res
[]
types
.
TicketMinerInfo
err
=
rpc
.
Call
(
"Chain33.QueryTicketInfoList"
,
params
,
&
res
)
if
err
!=
nil
{
fmt
.
Fprintln
(
os
.
Stderr
,
err
)
return
}
var
resp
[]
commandtypes
.
GetTicketMinerInfoResult
for
_
,
v
:=
range
res
{
var
ticket
commandtypes
.
GetTicketMinerInfoResult
ticket
.
TicketID
=
v
.
TicketId
switch
v
.
Status
{
case
1
:
ticket
.
Status
=
"openTicket"
case
2
:
ticket
.
Status
=
"minerTicket"
case
3
:
ticket
.
Status
=
"closeTicket"
}
switch
v
.
PrevStatus
{
case
1
:
ticket
.
PrevStatus
=
"openTicket"
case
2
:
ticket
.
PrevStatus
=
"minerTicket"
case
3
:
ticket
.
PrevStatus
=
"closeTicket"
}
ticket
.
IsGenesis
=
v
.
IsGenesis
ticket
.
CreateTime
=
time
.
Unix
(
v
.
CreateTime
,
0
)
.
Format
(
"20060102150405"
)
if
v
.
MinerTime
!=
0
{
ticket
.
MinerTime
=
time
.
Unix
(
v
.
MinerTime
,
0
)
.
Format
(
"20060102150405"
)
}
if
v
.
CloseTime
!=
0
{
ticket
.
CloseTime
=
time
.
Unix
(
v
.
CloseTime
,
0
)
.
Format
(
"20060102150405"
)
}
ticket
.
MinerValue
=
v
.
MinerValue
ticket
.
MinerAddress
=
v
.
MinerAddress
resp
=
append
(
resp
,
ticket
)
}
data
,
err
:=
json
.
MarshalIndent
(
resp
,
""
,
" "
)
if
err
!=
nil
{
fmt
.
Fprintln
(
os
.
Stderr
,
err
)
return
}
fmt
.
Println
(
string
(
data
))
}
// GetMinerStatCmd get miner stat
func
GetMinerStatCmd
()
*
cobra
.
Command
{
cmd
:=
&
cobra
.
Command
{
Use
:
"miner"
,
Short
:
"Get miner statistic"
,
Run
:
minerStat
,
}
addMinerStatCmdFlags
(
cmd
)
return
cmd
}
func
addMinerStatCmdFlags
(
cmd
*
cobra
.
Command
)
{
cmd
.
Flags
()
.
StringP
(
"addr"
,
"a"
,
""
,
"addr"
)
cmd
.
MarkFlagRequired
(
"addr"
)
cmd
.
Flags
()
.
Int64P
(
"height"
,
"t"
,
0
,
"start block height"
)
cmd
.
MarkFlagRequired
(
"height"
)
}
func
minerStat
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
rpcAddr
,
_
:=
cmd
.
Flags
()
.
GetString
(
"rpc_laddr"
)
addr
,
_
:=
cmd
.
Flags
()
.
GetString
(
"addr"
)
height
,
_
:=
cmd
.
Flags
()
.
GetInt64
(
"height"
)
if
err
:=
address
.
CheckAddress
(
addr
);
err
!=
nil
{
fmt
.
Fprintln
(
os
.
Stderr
,
err
)
return
}
if
height
<=
0
{
fmt
.
Fprintln
(
os
.
Stderr
,
fmt
.
Errorf
(
"input err, height:%v"
,
height
))
return
}
rpc
,
err
:=
jsonclient
.
NewJSONClient
(
rpcAddr
)
if
err
!=
nil
{
fmt
.
Fprintln
(
os
.
Stderr
,
err
)
return
}
// 获取最新高度
var
lastheader
rpctypes
.
Header
err
=
rpc
.
Call
(
"Chain33.GetLastHeader"
,
nil
,
&
lastheader
)
if
err
!=
nil
{
fmt
.
Fprintln
(
os
.
Stderr
,
err
)
return
}
// 循环取难度区间
var
diffList
[]
difficultyRange
var
diff
difficultyRange
startH
:=
height
diffListLoop
:
for
{
endH
:=
startH
+
10
if
endH
>
lastheader
.
Height
{
endH
=
lastheader
.
Height
}
params
:=
types
.
ReqBlocks
{
Start
:
startH
,
End
:
endH
,
IsDetail
:
false
,
}
var
respHeaders
rpctypes
.
Headers
err
=
rpc
.
Call
(
"Chain33.GetHeaders"
,
params
,
&
respHeaders
)
if
err
!=
nil
{
fmt
.
Fprintln
(
os
.
Stderr
,
err
)
return
}
for
_
,
h
:=
range
respHeaders
.
Items
{
if
diff
.
bits
!=
h
.
Difficulty
{
diff
.
timestamp
=
h
.
BlockTime
diff
.
height
=
h
.
Height
diff
.
bits
=
h
.
Difficulty
diff
.
diff
=
difficulty
.
CompactToBig
(
diff
.
bits
)
diffList
=
append
(
diffList
,
diff
)
}
}
if
len
(
respHeaders
.
Items
)
<
10
||
endH
+
1
>
lastheader
.
Height
{
// 最后一个点,记录截止时间
diff
.
timestamp
=
respHeaders
.
Items
[
len
(
respHeaders
.
Items
)
-
1
]
.
BlockTime
diffList
=
append
(
diffList
,
diff
)
break
diffListLoop
}
startH
=
endH
+
1
}
// 统计挖矿概率
bigOne
:=
big
.
NewInt
(
1
)
oneLsh256
:=
new
(
big
.
Int
)
.
Lsh
(
bigOne
,
256
)
oneLsh256
.
Sub
(
oneLsh256
,
bigOne
)
resp
:=
new
(
MinerResult
)
resp
.
Expect
=
new
(
big
.
Float
)
.
SetInt64
(
0
)
var
key
[]
byte
prefix
:=
[]
byte
(
"Statistics:TicketInfoOrder:Addr:"
+
addr
)
for
{
params
:=
types
.
LocalDBList
{
Prefix
:
prefix
,
Key
:
key
,
Direction
:
1
,
Count
:
10
}
var
res
[]
types
.
TicketMinerInfo
err
=
rpc
.
Call
(
"Chain33.QueryTicketInfoList"
,
params
,
&
res
)
if
err
!=
nil
{
fmt
.
Fprintln
(
os
.
Stderr
,
fmt
.
Errorf
(
"QueryTicketInfoList failed:%v"
,
err
))
fmt
.
Fprintln
(
os
.
Stderr
,
err
)
return
}
for
_
,
v
:=
range
res
{
if
v
.
CreateTime
<
diffList
[
0
]
.
timestamp
-
types
.
GetP
(
diffList
[
0
]
.
height
)
.
TicketFrozenTime
{
continue
}
//找到开始挖矿的难度坐标
var
pos
int
for
i
:=
range
diffList
{
//创建时间+冻结时间<右节点
if
v
.
CreateTime
>=
diffList
[
i
]
.
timestamp
-
types
.
GetP
(
diffList
[
i
]
.
height
)
.
TicketFrozenTime
{
continue
}
else
{
pos
=
i
-
1
break
}
}
diffList2
:=
diffList
[
pos
:
]
//没有挖到,还在挖
if
v
.
CloseTime
==
0
&&
v
.
MinerTime
==
0
{
for
i
:=
range
diffList2
{
if
i
==
0
{
continue
}
probability
:=
new
(
big
.
Float
)
.
Quo
(
new
(
big
.
Float
)
.
SetInt
(
diffList2
[
i
-
1
]
.
diff
),
new
(
big
.
Float
)
.
SetInt
(
oneLsh256
))
if
i
==
1
{
resp
.
Expect
=
resp
.
Expect
.
Add
(
resp
.
Expect
,
probability
.
Mul
(
probability
,
new
(
big
.
Float
)
.
SetInt64
(
diffList2
[
i
]
.
timestamp
-
v
.
CreateTime
-
types
.
GetP
(
diffList2
[
i
-
1
]
.
height
)
.
TicketFrozenTime
)))
}
else
{
resp
.
Expect
=
resp
.
Expect
.
Add
(
resp
.
Expect
,
probability
.
Mul
(
probability
,
new
(
big
.
Float
)
.
SetInt64
(
diffList2
[
i
]
.
timestamp
-
diffList2
[
i
-
1
]
.
timestamp
)))
}
}
}
//没有挖到,主动关闭
if
v
.
MinerTime
==
0
&&
v
.
CloseTime
!=
0
{
for
i
:=
range
diffList2
{
if
i
==
0
{
continue
}
probability
:=
new
(
big
.
Float
)
.
Quo
(
new
(
big
.
Float
)
.
SetInt
(
diffList2
[
i
-
1
]
.
diff
),
new
(
big
.
Float
)
.
SetInt
(
oneLsh256
))
if
i
==
1
{
resp
.
Expect
=
resp
.
Expect
.
Add
(
resp
.
Expect
,
probability
.
Mul
(
probability
,
new
(
big
.
Float
)
.
SetInt64
(
diffList2
[
i
]
.
timestamp
-
v
.
CreateTime
-
types
.
GetP
(
diffList2
[
i
-
1
]
.
height
)
.
TicketFrozenTime
)))
}
else
{
if
v
.
CloseTime
<=
diffList2
[
i
]
.
timestamp
{
resp
.
Expect
=
resp
.
Expect
.
Add
(
resp
.
Expect
,
probability
.
Mul
(
probability
,
new
(
big
.
Float
)
.
SetInt64
(
v
.
CloseTime
-
diffList2
[
i
-
1
]
.
timestamp
)))
break
}
else
{
resp
.
Expect
=
resp
.
Expect
.
Add
(
resp
.
Expect
,
probability
.
Mul
(
probability
,
new
(
big
.
Float
)
.
SetInt64
(
diffList2
[
i
]
.
timestamp
-
diffList2
[
i
-
1
]
.
timestamp
)))
}
}
}
}
//挖到
if
v
.
MinerTime
!=
0
{
for
i
:=
range
diffList2
{
if
i
==
0
{
continue
}
probability
:=
new
(
big
.
Float
)
.
Quo
(
new
(
big
.
Float
)
.
SetInt
(
diffList2
[
i
-
1
]
.
diff
),
new
(
big
.
Float
)
.
SetInt
(
oneLsh256
))
if
i
==
1
{
resp
.
Expect
=
resp
.
Expect
.
Add
(
resp
.
Expect
,
probability
.
Mul
(
probability
,
new
(
big
.
Float
)
.
SetInt64
(
diffList2
[
i
]
.
timestamp
-
v
.
CreateTime
-
types
.
GetP
(
diffList2
[
i
-
1
]
.
height
)
.
TicketFrozenTime
)))
}
else
{
if
v
.
MinerTime
<=
diffList2
[
i
]
.
timestamp
{
resp
.
Expect
=
resp
.
Expect
.
Add
(
resp
.
Expect
,
probability
.
Mul
(
probability
,
new
(
big
.
Float
)
.
SetInt64
(
v
.
MinerTime
-
diffList2
[
i
-
1
]
.
timestamp
)))
break
}
else
{
resp
.
Expect
=
resp
.
Expect
.
Add
(
resp
.
Expect
,
probability
.
Mul
(
probability
,
new
(
big
.
Float
)
.
SetInt64
(
diffList2
[
i
]
.
timestamp
-
diffList2
[
i
-
1
]
.
timestamp
)))
}
}
}
resp
.
Actual
++
}
}
if
len
(
res
)
<
10
{
break
}
key
=
[]
byte
(
"Statistics:TicketInfoOrder:Addr:"
+
addr
+
":CreateTime:"
+
time
.
Unix
(
res
[
len
(
res
)
-
1
]
.
CreateTime
,
0
)
.
Format
(
"20060102150405"
)
+
":TicketId:"
+
res
[
len
(
res
)
-
1
]
.
TicketId
)
}
expect
:=
resp
.
Expect
.
Text
(
'f'
,
2
)
fmt
.
Println
(
"Expect:"
,
expect
)
fmt
.
Println
(
"Actual:"
,
resp
.
Actual
)
e
,
_
:=
strconv
.
ParseFloat
(
expect
,
64
)
fmt
.
Printf
(
"Deviation:%+.3f%%
\n
"
,
(
float64
(
resp
.
Actual
)
/
e
-
1.0
)
*
100.0
)
}
type
difficultyRange
struct
{
timestamp
int64
height
int64
bits
uint32
diff
*
big
.
Int
}
// MinerResult defiles miner command
type
MinerResult
struct
{
Expect
*
big
.
Float
Actual
int64
}
// GetExecBalanceCmd get exec-addr balance of specific addr
// GetExecBalanceCmd get exec-addr balance of specific addr
func
GetExecBalanceCmd
()
*
cobra
.
Command
{
func
GetExecBalanceCmd
()
*
cobra
.
Command
{
cmd
:=
&
cobra
.
Command
{
cmd
:=
&
cobra
.
Command
{
...
...
vendor/github.com/33cn/chain33/system/dapp/commands/types/types.go
View file @
1c51e32d
...
@@ -148,26 +148,6 @@ type GetTotalCoinsResult struct {
...
@@ -148,26 +148,6 @@ type GetTotalCoinsResult struct {
DifferenceAmount
string
`json:"differenceAmount,omitempty"`
DifferenceAmount
string
`json:"differenceAmount,omitempty"`
}
}
// GetTicketStatisticResult defines ticketstatistic result rpc command
type
GetTicketStatisticResult
struct
{
CurrentOpenCount
int64
`json:"currentOpenCount"`
TotalMinerCount
int64
`json:"totalMinerCount"`
TotalCloseCount
int64
`json:"totalCloseCount"`
}
// GetTicketMinerInfoResult defines ticker minerinformation result rpc command
type
GetTicketMinerInfoResult
struct
{
TicketID
string
`json:"ticketId"`
Status
string
`json:"status"`
PrevStatus
string
`json:"prevStatus"`
IsGenesis
bool
`json:"isGenesis"`
CreateTime
string
`json:"createTime"`
MinerTime
string
`json:"minerTime"`
CloseTime
string
`json:"closeTime"`
MinerValue
int64
`json:"minerValue,omitempty"`
MinerAddress
string
`json:"minerAddress,omitempty"`
}
// UTXOGlobalIndex defines utxo globalindex command
// UTXOGlobalIndex defines utxo globalindex command
type
UTXOGlobalIndex
struct
{
type
UTXOGlobalIndex
struct
{
// Height int64 `json:"height,omitempty"`
// Height int64 `json:"height,omitempty"`
...
...
vendor/github.com/33cn/chain33/system/dapp/register.go
View file @
1c51e32d
...
@@ -35,20 +35,28 @@ func Register(name string, create DriverCreate, height int64) {
...
@@ -35,20 +35,28 @@ func Register(name string, create DriverCreate, height int64) {
if
_
,
dup
:=
registedExecDriver
[
name
];
dup
{
if
_
,
dup
:=
registedExecDriver
[
name
];
dup
{
panic
(
"Execute: Register called twice for driver "
+
name
)
panic
(
"Execute: Register called twice for driver "
+
name
)
}
}
driver
With
Height
:=
&
driverWithHeight
{
driverHeight
:=
&
driverWithHeight
{
create
:
create
,
create
:
create
,
height
:
height
,
height
:
height
,
}
}
registedExecDriver
[
name
]
=
driverWithHeight
registedExecDriver
[
name
]
=
driverHeight
//考虑到前期平行链兼容性和防止误操作(平行链下转账到一个主链合约),也会注册主链合约(不带前缀)的地址
registerAddress
(
name
)
execDrivers
[
ExecAddress
(
name
)]
=
driverHeight
if
types
.
IsPara
()
{
if
types
.
IsPara
()
{
paraHeight
:=
types
.
GetFork
(
"ForkEnableParaRegExec"
)
if
paraHeight
<
height
{
paraHeight
=
height
}
//平行链的合约地址是通过user.p.x.name计算的
//平行链的合约地址是通过user.p.x.name计算的
paraDriverName
:=
types
.
ExecName
(
name
)
paraDriverName
:=
types
.
ExecName
(
name
)
registerAddress
(
paraDriverName
)
registerAddress
(
paraDriverName
)
execDrivers
[
ExecAddress
(
paraDriverName
)]
=
driverWithHeight
execDrivers
[
ExecAddress
(
paraDriverName
)]
=
&
driverWithHeight
{
create
:
create
,
height
:
paraHeight
,
}
}
}
//考虑到前期平行链兼容性和防止误操作(平行链下转账到一个主链合约),也会注册主链合约(不带前缀)的地址
registerAddress
(
name
)
execDrivers
[
ExecAddress
(
name
)]
=
driverWithHeight
}
}
// LoadDriver load driver
// LoadDriver load driver
...
...
vendor/github.com/33cn/chain33/types/fork.go
View file @
1c51e32d
...
@@ -214,6 +214,8 @@ func SetTestNetFork() {
...
@@ -214,6 +214,8 @@ func SetTestNetFork() {
systemFork
.
SetFork
(
"chain33"
,
"ForkLocalDBAccess"
,
1572391
)
systemFork
.
SetFork
(
"chain33"
,
"ForkLocalDBAccess"
,
1572391
)
systemFork
.
SetFork
(
"chain33"
,
"ForkTxGroupPara"
,
1687250
)
systemFork
.
SetFork
(
"chain33"
,
"ForkTxGroupPara"
,
1687250
)
systemFork
.
SetFork
(
"chain33"
,
"ForkBase58AddressCheck"
,
1800000
)
systemFork
.
SetFork
(
"chain33"
,
"ForkBase58AddressCheck"
,
1800000
)
//这个fork只影响平行链,注册类似user.p.x.exec的driver,新开的平行链设为0即可,老的平行链要设置新的高度
systemFork
.
SetFork
(
"chain33"
,
"ForkEnableParaRegExec"
,
0
)
}
}
...
...
vendor/github.com/33cn/chain33/types/proto/statistic.proto
View file @
1c51e32d
...
@@ -34,33 +34,6 @@ message IterateRangeByStateHash {
...
@@ -34,33 +34,6 @@ message IterateRangeByStateHash {
int64
count
=
4
;
int64
count
=
4
;
}
}
message
TicketStatistic
{
//当前在挖的ticket
int64
currentOpenCount
=
1
;
//一共挖到的ticket
int64
totalMinerCount
=
2
;
//一共取消的ticket
int64
totalCancleCount
=
3
;
}
message
TicketMinerInfo
{
string
ticketId
=
1
;
// 1 -> 可挖矿 2 -> 已挖成功 3-> 已关闭
int32
status
=
2
;
int32
prevStatus
=
3
;
// genesis 创建的私钥比较特殊
bool
isGenesis
=
4
;
//创建ticket时间
int64
createTime
=
5
;
// ticket挖矿时间
int64
minerTime
=
6
;
//关闭ticket时间
int64
closeTime
=
7
;
//挖到的币的数目
int64
minerValue
=
8
;
string
minerAddress
=
9
;
}
message
TotalAmount
{
message
TotalAmount
{
// 统计的总数
// 统计的总数
int64
total
=
1
;
int64
total
=
1
;
...
...
vendor/github.com/33cn/chain33/types/statistic.pb.go
View file @
1c51e32d
...
@@ -269,173 +269,6 @@ func (m *IterateRangeByStateHash) GetCount() int64 {
...
@@ -269,173 +269,6 @@ func (m *IterateRangeByStateHash) GetCount() int64 {
return
0
return
0
}
}
type
TicketStatistic
struct
{
//当前在挖的ticket
CurrentOpenCount
int64
`protobuf:"varint,1,opt,name=currentOpenCount,proto3" json:"currentOpenCount,omitempty"`
//一共挖到的ticket
TotalMinerCount
int64
`protobuf:"varint,2,opt,name=totalMinerCount,proto3" json:"totalMinerCount,omitempty"`
//一共取消的ticket
TotalCancleCount
int64
`protobuf:"varint,3,opt,name=totalCancleCount,proto3" json:"totalCancleCount,omitempty"`
XXX_NoUnkeyedLiteral
struct
{}
`json:"-"`
XXX_unrecognized
[]
byte
`json:"-"`
XXX_sizecache
int32
`json:"-"`
}
func
(
m
*
TicketStatistic
)
Reset
()
{
*
m
=
TicketStatistic
{}
}
func
(
m
*
TicketStatistic
)
String
()
string
{
return
proto
.
CompactTextString
(
m
)
}
func
(
*
TicketStatistic
)
ProtoMessage
()
{}
func
(
*
TicketStatistic
)
Descriptor
()
([]
byte
,
[]
int
)
{
return
fileDescriptor_405f6cee9ed2da7e
,
[]
int
{
4
}
}
func
(
m
*
TicketStatistic
)
XXX_Unmarshal
(
b
[]
byte
)
error
{
return
xxx_messageInfo_TicketStatistic
.
Unmarshal
(
m
,
b
)
}
func
(
m
*
TicketStatistic
)
XXX_Marshal
(
b
[]
byte
,
deterministic
bool
)
([]
byte
,
error
)
{
return
xxx_messageInfo_TicketStatistic
.
Marshal
(
b
,
m
,
deterministic
)
}
func
(
m
*
TicketStatistic
)
XXX_Merge
(
src
proto
.
Message
)
{
xxx_messageInfo_TicketStatistic
.
Merge
(
m
,
src
)
}
func
(
m
*
TicketStatistic
)
XXX_Size
()
int
{
return
xxx_messageInfo_TicketStatistic
.
Size
(
m
)
}
func
(
m
*
TicketStatistic
)
XXX_DiscardUnknown
()
{
xxx_messageInfo_TicketStatistic
.
DiscardUnknown
(
m
)
}
var
xxx_messageInfo_TicketStatistic
proto
.
InternalMessageInfo
func
(
m
*
TicketStatistic
)
GetCurrentOpenCount
()
int64
{
if
m
!=
nil
{
return
m
.
CurrentOpenCount
}
return
0
}
func
(
m
*
TicketStatistic
)
GetTotalMinerCount
()
int64
{
if
m
!=
nil
{
return
m
.
TotalMinerCount
}
return
0
}
func
(
m
*
TicketStatistic
)
GetTotalCancleCount
()
int64
{
if
m
!=
nil
{
return
m
.
TotalCancleCount
}
return
0
}
type
TicketMinerInfo
struct
{
TicketId
string
`protobuf:"bytes,1,opt,name=ticketId,proto3" json:"ticketId,omitempty"`
// 1 -> 可挖矿 2 -> 已挖成功 3-> 已关闭
Status
int32
`protobuf:"varint,2,opt,name=status,proto3" json:"status,omitempty"`
PrevStatus
int32
`protobuf:"varint,3,opt,name=prevStatus,proto3" json:"prevStatus,omitempty"`
// genesis 创建的私钥比较特殊
IsGenesis
bool
`protobuf:"varint,4,opt,name=isGenesis,proto3" json:"isGenesis,omitempty"`
//创建ticket时间
CreateTime
int64
`protobuf:"varint,5,opt,name=createTime,proto3" json:"createTime,omitempty"`
// ticket挖矿时间
MinerTime
int64
`protobuf:"varint,6,opt,name=minerTime,proto3" json:"minerTime,omitempty"`
//关闭ticket时间
CloseTime
int64
`protobuf:"varint,7,opt,name=closeTime,proto3" json:"closeTime,omitempty"`
//挖到的币的数目
MinerValue
int64
`protobuf:"varint,8,opt,name=minerValue,proto3" json:"minerValue,omitempty"`
MinerAddress
string
`protobuf:"bytes,9,opt,name=minerAddress,proto3" json:"minerAddress,omitempty"`
XXX_NoUnkeyedLiteral
struct
{}
`json:"-"`
XXX_unrecognized
[]
byte
`json:"-"`
XXX_sizecache
int32
`json:"-"`
}
func
(
m
*
TicketMinerInfo
)
Reset
()
{
*
m
=
TicketMinerInfo
{}
}
func
(
m
*
TicketMinerInfo
)
String
()
string
{
return
proto
.
CompactTextString
(
m
)
}
func
(
*
TicketMinerInfo
)
ProtoMessage
()
{}
func
(
*
TicketMinerInfo
)
Descriptor
()
([]
byte
,
[]
int
)
{
return
fileDescriptor_405f6cee9ed2da7e
,
[]
int
{
5
}
}
func
(
m
*
TicketMinerInfo
)
XXX_Unmarshal
(
b
[]
byte
)
error
{
return
xxx_messageInfo_TicketMinerInfo
.
Unmarshal
(
m
,
b
)
}
func
(
m
*
TicketMinerInfo
)
XXX_Marshal
(
b
[]
byte
,
deterministic
bool
)
([]
byte
,
error
)
{
return
xxx_messageInfo_TicketMinerInfo
.
Marshal
(
b
,
m
,
deterministic
)
}
func
(
m
*
TicketMinerInfo
)
XXX_Merge
(
src
proto
.
Message
)
{
xxx_messageInfo_TicketMinerInfo
.
Merge
(
m
,
src
)
}
func
(
m
*
TicketMinerInfo
)
XXX_Size
()
int
{
return
xxx_messageInfo_TicketMinerInfo
.
Size
(
m
)
}
func
(
m
*
TicketMinerInfo
)
XXX_DiscardUnknown
()
{
xxx_messageInfo_TicketMinerInfo
.
DiscardUnknown
(
m
)
}
var
xxx_messageInfo_TicketMinerInfo
proto
.
InternalMessageInfo
func
(
m
*
TicketMinerInfo
)
GetTicketId
()
string
{
if
m
!=
nil
{
return
m
.
TicketId
}
return
""
}
func
(
m
*
TicketMinerInfo
)
GetStatus
()
int32
{
if
m
!=
nil
{
return
m
.
Status
}
return
0
}
func
(
m
*
TicketMinerInfo
)
GetPrevStatus
()
int32
{
if
m
!=
nil
{
return
m
.
PrevStatus
}
return
0
}
func
(
m
*
TicketMinerInfo
)
GetIsGenesis
()
bool
{
if
m
!=
nil
{
return
m
.
IsGenesis
}
return
false
}
func
(
m
*
TicketMinerInfo
)
GetCreateTime
()
int64
{
if
m
!=
nil
{
return
m
.
CreateTime
}
return
0
}
func
(
m
*
TicketMinerInfo
)
GetMinerTime
()
int64
{
if
m
!=
nil
{
return
m
.
MinerTime
}
return
0
}
func
(
m
*
TicketMinerInfo
)
GetCloseTime
()
int64
{
if
m
!=
nil
{
return
m
.
CloseTime
}
return
0
}
func
(
m
*
TicketMinerInfo
)
GetMinerValue
()
int64
{
if
m
!=
nil
{
return
m
.
MinerValue
}
return
0
}
func
(
m
*
TicketMinerInfo
)
GetMinerAddress
()
string
{
if
m
!=
nil
{
return
m
.
MinerAddress
}
return
""
}
type
TotalAmount
struct
{
type
TotalAmount
struct
{
// 统计的总数
// 统计的总数
Total
int64
`protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"`
Total
int64
`protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"`
...
@@ -448,7 +281,7 @@ func (m *TotalAmount) Reset() { *m = TotalAmount{} }
...
@@ -448,7 +281,7 @@ func (m *TotalAmount) Reset() { *m = TotalAmount{} }
func
(
m
*
TotalAmount
)
String
()
string
{
return
proto
.
CompactTextString
(
m
)
}
func
(
m
*
TotalAmount
)
String
()
string
{
return
proto
.
CompactTextString
(
m
)
}
func
(
*
TotalAmount
)
ProtoMessage
()
{}
func
(
*
TotalAmount
)
ProtoMessage
()
{}
func
(
*
TotalAmount
)
Descriptor
()
([]
byte
,
[]
int
)
{
func
(
*
TotalAmount
)
Descriptor
()
([]
byte
,
[]
int
)
{
return
fileDescriptor_405f6cee9ed2da7e
,
[]
int
{
6
}
return
fileDescriptor_405f6cee9ed2da7e
,
[]
int
{
4
}
}
}
func
(
m
*
TotalAmount
)
XXX_Unmarshal
(
b
[]
byte
)
error
{
func
(
m
*
TotalAmount
)
XXX_Unmarshal
(
b
[]
byte
)
error
{
...
@@ -494,7 +327,7 @@ func (m *ReqGetExecBalance) Reset() { *m = ReqGetExecBalance{} }
...
@@ -494,7 +327,7 @@ func (m *ReqGetExecBalance) Reset() { *m = ReqGetExecBalance{} }
func
(
m
*
ReqGetExecBalance
)
String
()
string
{
return
proto
.
CompactTextString
(
m
)
}
func
(
m
*
ReqGetExecBalance
)
String
()
string
{
return
proto
.
CompactTextString
(
m
)
}
func
(
*
ReqGetExecBalance
)
ProtoMessage
()
{}
func
(
*
ReqGetExecBalance
)
ProtoMessage
()
{}
func
(
*
ReqGetExecBalance
)
Descriptor
()
([]
byte
,
[]
int
)
{
func
(
*
ReqGetExecBalance
)
Descriptor
()
([]
byte
,
[]
int
)
{
return
fileDescriptor_405f6cee9ed2da7e
,
[]
int
{
7
}
return
fileDescriptor_405f6cee9ed2da7e
,
[]
int
{
5
}
}
}
func
(
m
*
ReqGetExecBalance
)
XXX_Unmarshal
(
b
[]
byte
)
error
{
func
(
m
*
ReqGetExecBalance
)
XXX_Unmarshal
(
b
[]
byte
)
error
{
...
@@ -577,7 +410,7 @@ func (m *ExecBalanceItem) Reset() { *m = ExecBalanceItem{} }
...
@@ -577,7 +410,7 @@ func (m *ExecBalanceItem) Reset() { *m = ExecBalanceItem{} }
func
(
m
*
ExecBalanceItem
)
String
()
string
{
return
proto
.
CompactTextString
(
m
)
}
func
(
m
*
ExecBalanceItem
)
String
()
string
{
return
proto
.
CompactTextString
(
m
)
}
func
(
*
ExecBalanceItem
)
ProtoMessage
()
{}
func
(
*
ExecBalanceItem
)
ProtoMessage
()
{}
func
(
*
ExecBalanceItem
)
Descriptor
()
([]
byte
,
[]
int
)
{
func
(
*
ExecBalanceItem
)
Descriptor
()
([]
byte
,
[]
int
)
{
return
fileDescriptor_405f6cee9ed2da7e
,
[]
int
{
8
}
return
fileDescriptor_405f6cee9ed2da7e
,
[]
int
{
6
}
}
}
func
(
m
*
ExecBalanceItem
)
XXX_Unmarshal
(
b
[]
byte
)
error
{
func
(
m
*
ExecBalanceItem
)
XXX_Unmarshal
(
b
[]
byte
)
error
{
...
@@ -635,7 +468,7 @@ func (m *ReplyGetExecBalance) Reset() { *m = ReplyGetExecBalance{} }
...
@@ -635,7 +468,7 @@ func (m *ReplyGetExecBalance) Reset() { *m = ReplyGetExecBalance{} }
func
(
m
*
ReplyGetExecBalance
)
String
()
string
{
return
proto
.
CompactTextString
(
m
)
}
func
(
m
*
ReplyGetExecBalance
)
String
()
string
{
return
proto
.
CompactTextString
(
m
)
}
func
(
*
ReplyGetExecBalance
)
ProtoMessage
()
{}
func
(
*
ReplyGetExecBalance
)
ProtoMessage
()
{}
func
(
*
ReplyGetExecBalance
)
Descriptor
()
([]
byte
,
[]
int
)
{
func
(
*
ReplyGetExecBalance
)
Descriptor
()
([]
byte
,
[]
int
)
{
return
fileDescriptor_405f6cee9ed2da7e
,
[]
int
{
9
}
return
fileDescriptor_405f6cee9ed2da7e
,
[]
int
{
7
}
}
}
func
(
m
*
ReplyGetExecBalance
)
XXX_Unmarshal
(
b
[]
byte
)
error
{
func
(
m
*
ReplyGetExecBalance
)
XXX_Unmarshal
(
b
[]
byte
)
error
{
...
@@ -696,8 +529,6 @@ func init() {
...
@@ -696,8 +529,6 @@ func init() {
proto
.
RegisterType
((
*
ReqGetTotalCoins
)(
nil
),
"types.ReqGetTotalCoins"
)
proto
.
RegisterType
((
*
ReqGetTotalCoins
)(
nil
),
"types.ReqGetTotalCoins"
)
proto
.
RegisterType
((
*
ReplyGetTotalCoins
)(
nil
),
"types.ReplyGetTotalCoins"
)
proto
.
RegisterType
((
*
ReplyGetTotalCoins
)(
nil
),
"types.ReplyGetTotalCoins"
)
proto
.
RegisterType
((
*
IterateRangeByStateHash
)(
nil
),
"types.IterateRangeByStateHash"
)
proto
.
RegisterType
((
*
IterateRangeByStateHash
)(
nil
),
"types.IterateRangeByStateHash"
)
proto
.
RegisterType
((
*
TicketStatistic
)(
nil
),
"types.TicketStatistic"
)
proto
.
RegisterType
((
*
TicketMinerInfo
)(
nil
),
"types.TicketMinerInfo"
)
proto
.
RegisterType
((
*
TotalAmount
)(
nil
),
"types.TotalAmount"
)
proto
.
RegisterType
((
*
TotalAmount
)(
nil
),
"types.TotalAmount"
)
proto
.
RegisterType
((
*
ReqGetExecBalance
)(
nil
),
"types.ReqGetExecBalance"
)
proto
.
RegisterType
((
*
ReqGetExecBalance
)(
nil
),
"types.ReqGetExecBalance"
)
proto
.
RegisterType
((
*
ExecBalanceItem
)(
nil
),
"types.ExecBalanceItem"
)
proto
.
RegisterType
((
*
ExecBalanceItem
)(
nil
),
"types.ExecBalanceItem"
)
...
@@ -707,45 +538,34 @@ func init() {
...
@@ -707,45 +538,34 @@ func init() {
func
init
()
{
proto
.
RegisterFile
(
"statistic.proto"
,
fileDescriptor_405f6cee9ed2da7e
)
}
func
init
()
{
proto
.
RegisterFile
(
"statistic.proto"
,
fileDescriptor_405f6cee9ed2da7e
)
}
var
fileDescriptor_405f6cee9ed2da7e
=
[]
byte
{
var
fileDescriptor_405f6cee9ed2da7e
=
[]
byte
{
// 637 bytes of a gzipped FileDescriptorProto
// 460 bytes of a gzipped FileDescriptorProto
0x1f
,
0x8b
,
0x08
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x02
,
0xff
,
0x9c
,
0x54
,
0xcd
,
0x6e
,
0xd3
,
0x40
,
0x1f
,
0x8b
,
0x08
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x02
,
0xff
,
0x9c
,
0x53
,
0xc1
,
0x6e
,
0xd3
,
0x40
,
0x10
,
0x96
,
0xeb
,
0x3a
,
0x4d
,
0xa7
,
0x95
,
0x12
,
0x96
,
0xaa
,
0x58
,
0x88
,
0x9f
,
0x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xa6
,
0xbd
,
0x2a
,
0xf2
,
0xef
,
0xa8
,
0xdd
,
0x2a
,
0x3a
,
0xc4
,
0xa2
,
0x54
,
0x94
,
0xdc
,
0x62
,
0x2d
,
0x4a
,
0x46
,
0xd1
,
0x6f
,
0x0f
,
0x1e
,
0xae
,
0xb4
,
0xbe
,
0x36
,
0x24
,
0x27
,
0x62
,
0xaf
,
0x23
,
0xe2
,
0x08
,
0x76
,
0xab
,
0xd3
,
0x69
,
0x3b
,
0x4b
,
0x87
,
0x6b
,
0xee
,
0x1c
,
0xb7
,
0x33
,
0x76
,
0xb8
,
0xfb
,
0x3f
,
0x03
,
0xf1
,
0x0a
,
0x82
,
0x84
,
0x30
,
0x33
,
0x61
,
0x70
,
0xe0
,
0x1f
,
0xee
,
0xbc
,
0xde
,
0x1f
,
0xf1
,
0x07
,
0x3b
,
0x5a
,
0x1b
,
0x42
,
0x5c
,
0x5d
,
0x3a
,
0x79
,
0xfe
,
0xf9
,
0xe9
,
0x75
,
0x42
,
0x37
,
0xe5
,
0xe5
,
0x48
,
0xe5
,
0xd9
,
0xd1
,
0x78
,
0xac
,
0xf4
,
0x91
,
0xba
,
0x91
,
0x89
,
0x1e
,
0x8f
,
0x8f
,
0xd8
,
0xef
,
0xb2
,
0xc7
,
0xdf
,
0xf4
,
0xf8
,
0x6f
,
0x00
,
0x00
,
0x00
,
0xff
,
0xff
,
0xbf
,
0x11
,
0x9f
,
0xa6
,
0xb9
,
0x05
,
0x00
,
0x00
,
}
}
vendor/github.com/33cn/chain33/types/testdata/guodun.toml
View file @
1c51e32d
...
@@ -176,6 +176,7 @@ ForkMultiSignAddress=1298600
...
@@ -176,6 +176,7 @@ ForkMultiSignAddress=1298600
ForkBlockCheck
=
1725000
ForkBlockCheck
=
1725000
ForkLocalDBAccess
=
1
ForkLocalDBAccess
=
1
ForkBase58AddressCheck
=
1800000
ForkBase58AddressCheck
=
1800000
ForkEnableParaRegExec
=
0
[fork.sub.coins]
[fork.sub.coins]
Enable
=
0
Enable
=
0
...
...
vendor/github.com/33cn/chain33/types/testdata/local.mvertest.toml
View file @
1c51e32d
...
@@ -197,6 +197,7 @@ ForkMultiSignAddress=1298600
...
@@ -197,6 +197,7 @@ ForkMultiSignAddress=1298600
ForkBlockCheck
=
1
ForkBlockCheck
=
1
ForkLocalDBAccess
=
0
ForkLocalDBAccess
=
0
ForkBase58AddressCheck
=
1800000
ForkBase58AddressCheck
=
1800000
ForkEnableParaRegExec
=
0
[fork.sub.coins]
[fork.sub.coins]
Enable
=
0
Enable
=
0
...
...
vendor/github.com/33cn/chain33/types/tx.go
View file @
1c51e32d
...
@@ -11,7 +11,7 @@ import (
...
@@ -11,7 +11,7 @@ import (
"reflect"
"reflect"
"time"
"time"
"github.com/hashicorp/golang-lru"
lru
"github.com/hashicorp/golang-lru"
"strconv"
"strconv"
...
@@ -172,8 +172,8 @@ func (txgroup *Transactions) IsExpire(height, blocktime int64) bool {
...
@@ -172,8 +172,8 @@ func (txgroup *Transactions) IsExpire(height, blocktime int64) bool {
return
false
return
false
}
}
//Check
height == 0 的时候,不做检查
//Check
WithFork 和fork 无关的有个检查函数
func
(
txgroup
*
Transactions
)
Check
(
height
,
minfee
,
maxFee
int64
)
error
{
func
(
txgroup
*
Transactions
)
Check
WithFork
(
checkFork
,
paraFork
bool
,
height
,
minfee
,
maxFee
int64
)
error
{
txs
:=
txgroup
.
Txs
txs
:=
txgroup
.
Txs
if
len
(
txs
)
<
2
{
if
len
(
txs
)
<
2
{
return
ErrTxGroupCountLessThanTwo
return
ErrTxGroupCountLessThanTwo
...
@@ -193,7 +193,7 @@ func (txgroup *Transactions) Check(height, minfee, maxFee int64) error {
...
@@ -193,7 +193,7 @@ func (txgroup *Transactions) Check(height, minfee, maxFee int64) error {
}
}
//txgroup 只允许一条平行链的交易, 且平行链txgroup须全部是平行链tx
//txgroup 只允许一条平行链的交易, 且平行链txgroup须全部是平行链tx
//如果平行链已经在主链分叉高度前运行了一段时间且有跨链交易,平行链需要自己设置这个fork
//如果平行链已经在主链分叉高度前运行了一段时间且有跨链交易,平行链需要自己设置这个fork
if
IsFork
(
height
,
"ForkTxGroupPara"
)
{
if
paraFork
{
if
len
(
para
)
>
1
{
if
len
(
para
)
>
1
{
tlog
.
Info
(
"txgroup has multi para transaction"
)
tlog
.
Info
(
"txgroup has multi para transaction"
)
return
ErrTxGroupParaCount
return
ErrTxGroupParaCount
...
@@ -225,7 +225,7 @@ func (txgroup *Transactions) Check(height, minfee, maxFee int64) error {
...
@@ -225,7 +225,7 @@ func (txgroup *Transactions) Check(height, minfee, maxFee int64) error {
if
txs
[
0
]
.
Fee
<
totalfee
{
if
txs
[
0
]
.
Fee
<
totalfee
{
return
ErrTxFeeTooLow
return
ErrTxFeeTooLow
}
}
if
txs
[
0
]
.
Fee
>
maxFee
&&
maxFee
>
0
&&
IsFork
(
height
,
"ForkBlockCheck"
)
{
if
txs
[
0
]
.
Fee
>
maxFee
&&
maxFee
>
0
&&
checkFork
{
return
ErrTxFeeTooHigh
return
ErrTxFeeTooHigh
}
}
//检查hash是否符合要求
//检查hash是否符合要求
...
@@ -261,6 +261,13 @@ func (txgroup *Transactions) Check(height, minfee, maxFee int64) error {
...
@@ -261,6 +261,13 @@ func (txgroup *Transactions) Check(height, minfee, maxFee int64) error {
return
nil
return
nil
}
}
//Check height == 0 的时候,不做检查
func
(
txgroup
*
Transactions
)
Check
(
height
,
minfee
,
maxFee
int64
)
error
{
paraFork
:=
IsFork
(
height
,
"ForkTxGroupPara"
)
checkFork
:=
IsFork
(
height
,
"ForkBlockCheck"
)
return
txgroup
.
CheckWithFork
(
checkFork
,
paraFork
,
height
,
minfee
,
maxFee
)
}
//TransactionCache 交易缓存结构
//TransactionCache 交易缓存结构
type
TransactionCache
struct
{
type
TransactionCache
struct
{
*
Transaction
*
Transaction
...
...
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