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
99259168
Commit
99259168
authored
Dec 05, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
upped proto version and modified block pool
parent
095cb976
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
18 additions
and
17 deletions
+18
-17
block_pool.go
block_pool.go
+1
-1
main.go
cmd/ethereum/main.go
+1
-1
gui.go
cmd/mist/gui.go
+0
-4
main.go
cmd/mist/main.go
+1
-1
chain_manager.go
core/chain_manager.go
+15
-9
miner.go
miner/miner.go
+0
-1
No files found.
block_pool.go
View file @
99259168
...
@@ -154,7 +154,7 @@ func (self *BlockPool) addBlock(b *types.Block, peer *Peer, newBlock bool) {
...
@@ -154,7 +154,7 @@ func (self *BlockPool) addBlock(b *types.Block, peer *Peer, newBlock bool) {
fmt
.
Println
(
"1."
,
!
self
.
eth
.
ChainManager
()
.
HasBlock
(
b
.
PrevHash
),
ethutil
.
Bytes2Hex
(
b
.
Hash
()[
0
:
4
]),
ethutil
.
Bytes2Hex
(
b
.
PrevHash
[
0
:
4
]))
fmt
.
Println
(
"1."
,
!
self
.
eth
.
ChainManager
()
.
HasBlock
(
b
.
PrevHash
),
ethutil
.
Bytes2Hex
(
b
.
Hash
()[
0
:
4
]),
ethutil
.
Bytes2Hex
(
b
.
PrevHash
[
0
:
4
]))
fmt
.
Println
(
"2."
,
self
.
pool
[
string
(
b
.
PrevHash
)]
==
nil
)
fmt
.
Println
(
"2."
,
self
.
pool
[
string
(
b
.
PrevHash
)]
==
nil
)
fmt
.
Println
(
"3."
,
!
self
.
fetchingHashes
)
fmt
.
Println
(
"3."
,
!
self
.
fetchingHashes
)
if
!
self
.
eth
.
ChainManager
()
.
HasBlock
(
b
.
PrevHash
)
&&
self
.
pool
[
string
(
b
.
PrevHash
)]
==
nil
&&
!
self
.
fetchingHashes
{
if
!
self
.
eth
.
ChainManager
()
.
HasBlock
(
b
.
PrevHash
)
/*&& self.pool[string(b.PrevHash)] == nil*/
&&
!
self
.
fetchingHashes
{
poollogger
.
Infof
(
"Unknown chain, requesting (%x...)
\n
"
,
b
.
PrevHash
[
0
:
4
])
poollogger
.
Infof
(
"Unknown chain, requesting (%x...)
\n
"
,
b
.
PrevHash
[
0
:
4
])
peer
.
QueueMessage
(
wire
.
NewMessage
(
wire
.
MsgGetBlockHashesTy
,
[]
interface
{}{
b
.
Hash
(),
uint32
(
256
)}))
peer
.
QueueMessage
(
wire
.
NewMessage
(
wire
.
MsgGetBlockHashesTy
,
[]
interface
{}{
b
.
Hash
(),
uint32
(
256
)}))
}
}
...
...
cmd/ethereum/main.go
View file @
99259168
...
@@ -30,7 +30,7 @@ import (
...
@@ -30,7 +30,7 @@ import (
const
(
const
(
ClientIdentifier
=
"Ethereum(G)"
ClientIdentifier
=
"Ethereum(G)"
Version
=
"0.7.
8
"
Version
=
"0.7.
9
"
)
)
var
clilogger
=
logger
.
NewLogger
(
"CLI"
)
var
clilogger
=
logger
.
NewLogger
(
"CLI"
)
...
...
cmd/mist/gui.go
View file @
99259168
...
@@ -389,7 +389,6 @@ func (gui *Gui) update() {
...
@@ -389,7 +389,6 @@ func (gui *Gui) update() {
gui
.
loadAddressBook
()
gui
.
loadAddressBook
()
gui
.
loadMergedMiningOptions
()
gui
.
loadMergedMiningOptions
()
gui
.
setPeerInfo
()
gui
.
setPeerInfo
()
//gui.readPreviousTransactions()
}()
}()
for
_
,
plugin
:=
range
gui
.
plugins
{
for
_
,
plugin
:=
range
gui
.
plugins
{
...
@@ -417,9 +416,6 @@ func (gui *Gui) update() {
...
@@ -417,9 +416,6 @@ func (gui *Gui) update() {
core
.
TxPostEvent
{},
core
.
TxPostEvent
{},
)
)
// nameReg := gui.pipe.World().Config().Get("NameReg")
// mux.Subscribe("object:"+string(nameReg.Address()), objectChan)
go
func
()
{
go
func
()
{
defer
events
.
Unsubscribe
()
defer
events
.
Unsubscribe
()
for
{
for
{
...
...
cmd/mist/main.go
View file @
99259168
...
@@ -31,7 +31,7 @@ import (
...
@@ -31,7 +31,7 @@ import (
const
(
const
(
ClientIdentifier
=
"Mist"
ClientIdentifier
=
"Mist"
Version
=
"0.7.
8
"
Version
=
"0.7.
9
"
)
)
var
ethereum
*
eth
.
Ethereum
var
ethereum
*
eth
.
Ethereum
...
...
core/chain_manager.go
View file @
99259168
...
@@ -125,7 +125,8 @@ func (bc *ChainManager) Reset() {
...
@@ -125,7 +125,8 @@ func (bc *ChainManager) Reset() {
bc
.
genesisBlock
.
Trie
()
.
Sync
()
bc
.
genesisBlock
.
Trie
()
.
Sync
()
// Prepare the genesis block
// Prepare the genesis block
bc
.
add
(
bc
.
genesisBlock
)
bc
.
write
(
bc
.
genesisBlock
)
bc
.
insert
(
bc
.
genesisBlock
)
bc
.
CurrentBlock
=
bc
.
genesisBlock
bc
.
CurrentBlock
=
bc
.
genesisBlock
bc
.
SetTotalDifficulty
(
ethutil
.
Big
(
"0"
))
bc
.
SetTotalDifficulty
(
ethutil
.
Big
(
"0"
))
...
@@ -134,18 +135,18 @@ func (bc *ChainManager) Reset() {
...
@@ -134,18 +135,18 @@ func (bc *ChainManager) Reset() {
bc
.
TD
=
ethutil
.
BigD
(
ethutil
.
Config
.
Db
.
LastKnownTD
())
bc
.
TD
=
ethutil
.
BigD
(
ethutil
.
Config
.
Db
.
LastKnownTD
())
}
}
// Add a block to the chain and record addition information
func
(
bc
*
ChainManager
)
insert
(
block
*
types
.
Block
)
{
func
(
bc
*
ChainManager
)
add
(
block
*
types
.
Block
)
{
encodedBlock
:=
block
.
RlpEncode
()
bc
.
writeBlockInfo
(
block
)
ethutil
.
Config
.
Db
.
Put
([]
byte
(
"LastBlock"
),
encodedBlock
)
bc
.
CurrentBlock
=
block
bc
.
CurrentBlock
=
block
bc
.
LastBlockHash
=
block
.
Hash
()
bc
.
LastBlockHash
=
block
.
Hash
()
}
func
(
bc
*
ChainManager
)
write
(
block
*
types
.
Block
)
{
bc
.
writeBlockInfo
(
block
)
encodedBlock
:=
block
.
RlpEncode
()
encodedBlock
:=
block
.
RlpEncode
()
ethutil
.
Config
.
Db
.
Put
(
block
.
Hash
(),
encodedBlock
)
ethutil
.
Config
.
Db
.
Put
(
block
.
Hash
(),
encodedBlock
)
ethutil
.
Config
.
Db
.
Put
([]
byte
(
"LastBlock"
),
encodedBlock
)
//chainlogger.Infof("Imported block #%d (%x...)\n", block.Number, block.Hash()[0:4])
}
}
// Accessors
// Accessors
...
@@ -266,9 +267,14 @@ func (self *ChainManager) InsertChain(chain types.Blocks) error {
...
@@ -266,9 +267,14 @@ func (self *ChainManager) InsertChain(chain types.Blocks) error {
return
err
return
err
}
}
self
.
add
(
block
)
self
.
write
(
block
)
if
td
.
Cmp
(
self
.
TD
)
>
0
{
if
td
.
Cmp
(
self
.
TD
)
>
0
{
if
block
.
Number
.
Cmp
(
new
(
big
.
Int
)
.
Add
(
self
.
CurrentBlock
.
Number
,
ethutil
.
Big1
))
<
0
{
chainlogger
.
Infof
(
"Split detected. New head #%v (%x), was #%v (%x)
\n
"
,
block
.
Number
,
block
.
Hash
()[
:
4
],
self
.
CurrentBlock
.
Number
,
self
.
CurrentBlock
.
Hash
()[
:
4
])
}
self
.
SetTotalDifficulty
(
td
)
self
.
SetTotalDifficulty
(
td
)
self
.
insert
(
block
)
}
}
self
.
eventMux
.
Post
(
NewBlockEvent
{
block
})
self
.
eventMux
.
Post
(
NewBlockEvent
{
block
})
...
...
miner/miner.go
View file @
99259168
...
@@ -167,7 +167,6 @@ out:
...
@@ -167,7 +167,6 @@ out:
}
}
func
(
self
*
Miner
)
reset
()
{
func
(
self
*
Miner
)
reset
()
{
println
(
"reset"
)
close
(
self
.
powQuitCh
)
close
(
self
.
powQuitCh
)
self
.
powQuitCh
=
make
(
chan
struct
{})
self
.
powQuitCh
=
make
(
chan
struct
{})
}
}
...
...
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