Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
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
张蕾
Geth-Modification
Commits
65eee200
Commit
65eee200
authored
Mar 17, 2015
by
Felix Lange
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pow/ezp: use common.Hash
parent
27f7aa01
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
7 deletions
+4
-7
pow.go
pow/ezp/pow.go
+4
-7
No files found.
pow/ezp/pow.go
View file @
65eee200
...
...
@@ -6,8 +6,8 @@ import (
"math/rand"
"time"
"github.com/ethereum/go-ethereum/crypto/sha3"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto/sha3"
"github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/pow"
)
...
...
@@ -83,17 +83,14 @@ func (pow *EasyPow) Verify(block pow.Block) bool {
return
Verify
(
block
)
}
func
verify
(
hash
[]
byte
,
diff
*
big
.
Int
,
nonce
uint64
)
bool
{
func
verify
(
hash
common
.
Hash
,
diff
*
big
.
Int
,
nonce
uint64
)
bool
{
sha
:=
sha3
.
NewKeccak256
()
n
:=
make
([]
byte
,
8
)
binary
.
PutUvarint
(
n
,
nonce
)
d
:=
append
(
hash
,
n
...
)
sha
.
Write
(
d
)
sha
.
Write
(
n
)
sha
.
Write
(
hash
[
:
])
verification
:=
new
(
big
.
Int
)
.
Div
(
common
.
BigPow
(
2
,
256
),
diff
)
res
:=
common
.
BigD
(
sha
.
Sum
(
nil
))
return
res
.
Cmp
(
verification
)
<=
0
}
...
...
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