Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
whqwjb
go-ethereum
提交
99259168
G
go-ethereum
项目概览
whqwjb
/
go-ethereum
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
go-ethereum
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
99259168
编写于
12月 05, 2014
作者:
O
obscuren
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
upped proto version and modified block pool
上级
095cb976
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
18 addition
and
17 deletion
+18
-17
block_pool.go
block_pool.go
+1
-1
cmd/ethereum/main.go
cmd/ethereum/main.go
+1
-1
cmd/mist/gui.go
cmd/mist/gui.go
+0
-4
cmd/mist/main.go
cmd/mist/main.go
+1
-1
core/chain_manager.go
core/chain_manager.go
+15
-9
miner/miner.go
miner/miner.go
+0
-1
未找到文件。
block_pool.go
浏览文件 @
99259168
...
...
@@ -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
(
"2."
,
self
.
pool
[
string
(
b
.
PrevHash
)]
==
nil
)
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
])
peer
.
QueueMessage
(
wire
.
NewMessage
(
wire
.
MsgGetBlockHashesTy
,
[]
interface
{}{
b
.
Hash
(),
uint32
(
256
)}))
}
...
...
cmd/ethereum/main.go
浏览文件 @
99259168
...
...
@@ -30,7 +30,7 @@ import (
const
(
ClientIdentifier
=
"Ethereum(G)"
Version
=
"0.7.
8
"
Version
=
"0.7.
9
"
)
var
clilogger
=
logger
.
NewLogger
(
"CLI"
)
...
...
cmd/mist/gui.go
浏览文件 @
99259168
...
...
@@ -389,7 +389,6 @@ func (gui *Gui) update() {
gui
.
loadAddressBook
()
gui
.
loadMergedMiningOptions
()
gui
.
setPeerInfo
()
//gui.readPreviousTransactions()
}()
for
_
,
plugin
:=
range
gui
.
plugins
{
...
...
@@ -417,9 +416,6 @@ func (gui *Gui) update() {
core
.
TxPostEvent
{},
)
// nameReg := gui.pipe.World().Config().Get("NameReg")
// mux.Subscribe("object:"+string(nameReg.Address()), objectChan)
go
func
()
{
defer
events
.
Unsubscribe
()
for
{
...
...
cmd/mist/main.go
浏览文件 @
99259168
...
...
@@ -31,7 +31,7 @@ import (
const
(
ClientIdentifier
=
"Mist"
Version
=
"0.7.
8
"
Version
=
"0.7.
9
"
)
var
ethereum
*
eth
.
Ethereum
...
...
core/chain_manager.go
浏览文件 @
99259168
...
...
@@ -125,7 +125,8 @@ func (bc *ChainManager) Reset() {
bc
.
genesisBlock
.
Trie
()
.
Sync
()
// Prepare the genesis block
bc
.
add
(
bc
.
genesisBlock
)
bc
.
write
(
bc
.
genesisBlock
)
bc
.
insert
(
bc
.
genesisBlock
)
bc
.
CurrentBlock
=
bc
.
genesisBlock
bc
.
SetTotalDifficulty
(
ethutil
.
Big
(
"0"
))
...
...
@@ -134,18 +135,18 @@ func (bc *ChainManager) Reset() {
bc
.
TD
=
ethutil
.
BigD
(
ethutil
.
Config
.
Db
.
LastKnownTD
())
}
// Add a block to the chain and record addition information
func
(
bc
*
ChainManager
)
add
(
block
*
types
.
Block
)
{
bc
.
writeBlockInfo
(
block
)
func
(
bc
*
ChainManager
)
insert
(
block
*
types
.
Block
)
{
encodedBlock
:=
block
.
RlpEncode
()
ethutil
.
Config
.
Db
.
Put
([]
byte
(
"LastBlock"
),
encodedBlock
)
bc
.
CurrentBlock
=
block
bc
.
LastBlockHash
=
block
.
Hash
()
}
func
(
bc
*
ChainManager
)
write
(
block
*
types
.
Block
)
{
bc
.
writeBlockInfo
(
block
)
encodedBlock
:=
block
.
RlpEncode
()
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
...
...
@@ -266,9 +267,14 @@ func (self *ChainManager) InsertChain(chain types.Blocks) error {
return
err
}
self
.
add
(
block
)
self
.
write
(
block
)
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
.
insert
(
block
)
}
self
.
eventMux
.
Post
(
NewBlockEvent
{
block
})
...
...
miner/miner.go
浏览文件 @
99259168
...
...
@@ -167,7 +167,6 @@ out:
}
func
(
self
*
Miner
)
reset
()
{
println
(
"reset"
)
close
(
self
.
powQuitCh
)
self
.
powQuitCh
=
make
(
chan
struct
{})
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录