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
ca7bee20
Commit
ca7bee20
authored
Jul 23, 2019
by
harrylee
Committed by
vipwzw
Jul 26, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix a bug for hashlock dapp
parent
22564a02
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
4 deletions
+12
-4
chain33.para.toml
chain33.para.toml
+1
-0
hashlockdb.go
plugin/dapp/hashlock/executor/hashlockdb.go
+6
-3
hashlock.go
plugin/dapp/hashlock/types/hashlock.go
+1
-0
types.go
plugin/dapp/hashlock/types/types.go
+4
-1
No files found.
chain33.para.toml
View file @
ca7bee20
...
@@ -216,6 +216,7 @@ ForkRetrive=0
...
@@ -216,6 +216,7 @@ ForkRetrive=0
[fork.sub.hashlock]
[fork.sub.hashlock]
Enable
=
0
Enable
=
0
ForkBadRepeatSecret
=
0
[fork.sub.manage]
[fork.sub.manage]
Enable
=
0
Enable
=
0
...
...
plugin/dapp/hashlock/executor/hashlockdb.go
View file @
ca7bee20
...
@@ -89,10 +89,13 @@ func (action *Action) Hashlocklock(hlock *pty.HashlockLock) (*types.Receipt, err
...
@@ -89,10 +89,13 @@ func (action *Action) Hashlocklock(hlock *pty.HashlockLock) (*types.Receipt, err
var
logs
[]
*
types
.
ReceiptLog
var
logs
[]
*
types
.
ReceiptLog
var
kv
[]
*
types
.
KeyValue
var
kv
[]
*
types
.
KeyValue
var
err
error
//不存在相同的hashlock,假定采用sha256
//不存在相同的hashlock,假定采用sha256
//_, err := readHashlock(action.db, hlock.Hash)
if
types
.
IsDappFork
(
action
.
height
,
pty
.
HashlockX
,
pty
.
ForkBadRepeatSecretX
)
{
_
,
err
:=
readHashlock
(
action
.
db
,
common
.
Sha256
(
hlock
.
Hash
))
_
,
err
=
readHashlock
(
action
.
db
,
hlock
.
Hash
)
}
else
{
_
,
err
=
readHashlock
(
action
.
db
,
common
.
Sha256
(
hlock
.
Hash
))
}
if
err
!=
types
.
ErrNotFound
{
if
err
!=
types
.
ErrNotFound
{
hlog
.
Error
(
"Hashlocklock"
,
"hlock.Hash repeated"
,
hlock
.
Hash
)
hlog
.
Error
(
"Hashlocklock"
,
"hlock.Hash repeated"
,
hlock
.
Hash
)
return
nil
,
pty
.
ErrHashlockReapeathash
return
nil
,
pty
.
ErrHashlockReapeathash
...
...
plugin/dapp/hashlock/types/hashlock.go
View file @
ca7bee20
...
@@ -21,6 +21,7 @@ func init() {
...
@@ -21,6 +21,7 @@ func init() {
types
.
AllowUserExec
=
append
(
types
.
AllowUserExec
,
[]
byte
(
HashlockX
))
types
.
AllowUserExec
=
append
(
types
.
AllowUserExec
,
[]
byte
(
HashlockX
))
types
.
RegistorExecutor
(
HashlockX
,
NewType
())
types
.
RegistorExecutor
(
HashlockX
,
NewType
())
types
.
RegisterDappFork
(
HashlockX
,
"Enable"
,
0
)
types
.
RegisterDappFork
(
HashlockX
,
"Enable"
,
0
)
types
.
RegisterDappFork
(
HashlockX
,
ForkBadRepeatSecretX
,
3000000
)
}
}
// HashlockType def
// HashlockType def
...
...
plugin/dapp/hashlock/types/types.go
View file @
ca7bee20
...
@@ -12,4 +12,7 @@ const (
...
@@ -12,4 +12,7 @@ const (
)
)
// HashlockX name
// HashlockX name
var
HashlockX
=
"hashlock"
var
(
HashlockX
=
"hashlock"
ForkBadRepeatSecretX
=
"ForkBadRepeatSecret"
)
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