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
d7564a9a
Commit
d7564a9a
authored
Mar 19, 2015
by
zelig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix common.Hash conversion
parent
8987750a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
3 deletions
+5
-3
peers.go
blockpool/peers.go
+2
-0
peers_test.go
blockpool/peers_test.go
+2
-2
section.go
blockpool/section.go
+1
-1
No files found.
blockpool/peers.go
View file @
d7564a9a
...
@@ -7,6 +7,7 @@ import (
...
@@ -7,6 +7,7 @@ import (
"sync"
"sync"
"time"
"time"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/errs"
"github.com/ethereum/go-ethereum/errs"
)
)
...
@@ -471,6 +472,7 @@ func (self *peer) getBlockHashes() {
...
@@ -471,6 +472,7 @@ func (self *peer) getBlockHashes() {
}
}
}
}
headKey
:=
self
.
parentHash
.
Str
()
headKey
:=
self
.
parentHash
.
Str
()
height
:=
self
.
bp
.
status
.
chain
[
headKey
]
+
1
self
.
bp
.
status
.
chain
[
self
.
currentBlockHash
.
Str
()]
=
height
self
.
bp
.
status
.
chain
[
self
.
currentBlockHash
.
Str
()]
=
height
if
height
>
self
.
bp
.
status
.
values
.
LongestChain
{
if
height
>
self
.
bp
.
status
.
values
.
LongestChain
{
self
.
bp
.
status
.
values
.
LongestChain
=
height
self
.
bp
.
status
.
values
.
LongestChain
=
height
...
...
blockpool/peers_test.go
View file @
d7564a9a
...
@@ -170,8 +170,8 @@ func TestPeerPromotionByOptionalTdOnBlock(t *testing.T) {
...
@@ -170,8 +170,8 @@ func TestPeerPromotionByOptionalTdOnBlock(t *testing.T) {
hashes
:=
blockPoolTester
.
hashPool
.
IndexesToHashes
([]
int
{
2
,
3
})
hashes
:=
blockPoolTester
.
hashPool
.
IndexesToHashes
([]
int
{
2
,
3
})
peer1
.
waitBlocksRequests
(
3
)
peer1
.
waitBlocksRequests
(
3
)
blockPool
.
AddBlock
(
&
types
.
Block
{
blockPool
.
AddBlock
(
&
types
.
Block
{
HeaderHash
:
common
.
Bytes
(
hashes
[
1
]),
HeaderHash
:
common
.
Hash
(
hashes
[
1
]),
ParentHeaderHash
:
common
.
Bytes
(
hashes
[
0
]),
ParentHeaderHash
:
common
.
Hash
(
hashes
[
0
]),
Td
:
common
.
Big3
,
Td
:
common
.
Big3
,
},
"peer1"
)
},
"peer1"
)
...
...
blockpool/section.go
View file @
d7564a9a
...
@@ -117,7 +117,7 @@ func (self *section) addSectionToBlockChain(p *peer) {
...
@@ -117,7 +117,7 @@ func (self *section) addSectionToBlockChain(p *peer) {
break
break
}
}
self
.
poolRootIndex
--
self
.
poolRootIndex
--
keys
=
append
(
keys
,
n
ode
.
hash
.
Str
())
keys
=
append
(
keys
,
n
.
hash
.
Str
())
blocks
=
append
(
blocks
,
block
)
blocks
=
append
(
blocks
,
block
)
nodes
=
append
(
nodes
,
n
)
nodes
=
append
(
nodes
,
n
)
}
}
...
...
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