Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
whqwjb
go-ethereum
提交
c9985bf5
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,发现更多精彩内容 >>
提交
c9985bf5
编写于
1月 05, 2015
作者:
O
obscuren
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixed peer window. Minor tweaks and fixes
上级
22c0c546
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
37 addition
and
53 deletion
+37
-53
cmd/ethereum/main.go
cmd/ethereum/main.go
+1
-1
cmd/mist/assets/qml/main.qml
cmd/mist/assets/qml/main.qml
+8
-12
cmd/mist/assets/qml/views/whisper.qml
cmd/mist/assets/qml/views/whisper.qml
+0
-1
cmd/mist/bindings.go
cmd/mist/bindings.go
+1
-1
cmd/mist/gui.go
cmd/mist/gui.go
+9
-10
cmd/mist/main.go
cmd/mist/main.go
+2
-1
pow/ezp/pow.go
pow/ezp/pow.go
+1
-1
xeth/js_types.go
xeth/js_types.go
+15
-26
未找到文件。
cmd/ethereum/main.go
浏览文件 @
c9985bf5
...
...
@@ -32,7 +32,7 @@ import (
const
(
ClientIdentifier
=
"Ethereum(G)"
Version
=
"0.8.
0
"
Version
=
"0.8.
1
"
)
var
clilogger
=
logger
.
NewLogger
(
"CLI"
)
...
...
cmd/mist/assets/qml/main.qml
浏览文件 @
c9985bf5
...
...
@@ -512,18 +512,17 @@ ApplicationWindow {
var
section
;
switch
(
options
.
section
)
{
case
"
ethereum
"
:
section
=
menuDefault
;
break
;
section
=
menuDefault
;
break
;
case
"
legacy
"
:
section
=
menuLegacy
;
break
;
section
=
menuLegacy
;
break
;
default
:
section
=
menuApps
;
break
;
section
=
menuApps
;
break
;
}
var
comp
=
menuItemTemplate
.
createObject
(
section
)
comp
.
view
=
view
comp
.
title
=
view
.
title
...
...
@@ -771,12 +770,9 @@ ApplicationWindow {
anchors.fill
:
parent
id
:
peerTable
model
:
peerModel
TableViewColumn
{
width
:
100
;
role
:
"
ip
"
;
title
:
"
IP
"
}
TableViewColumn
{
width
:
60
;
role
:
"
port
"
;
title
:
"
Port
"
}
TableViewColumn
{
width
:
140
;
role
:
"
lastResponse
"
;
title
:
"
Last event
"
}
TableViewColumn
{
width
:
100
;
role
:
"
latency
"
;
title
:
"
Latency
"
}
TableViewColumn
{
width
:
200
;
role
:
"
ip
"
;
title
:
"
IP
"
}
TableViewColumn
{
width
:
260
;
role
:
"
version
"
;
title
:
"
Version
"
}
TableViewColumn
{
width
:
80
;
role
:
"
caps
"
;
title
:
"
Capabilities
"
}
TableViewColumn
{
width
:
1
80
;
role
:
"
caps
"
;
title
:
"
Capabilities
"
}
}
}
}
...
...
cmd/mist/assets/qml/views/whisper.qml
浏览文件 @
c9985bf5
...
...
@@ -10,7 +10,6 @@ import Ethereum 1.0
Rectangle
{
id
:
root
property
var
title
:
"
Whisper Traffic
"
property
var
iconSource
:
"
../facet.png
"
property
var
menuItem
objectName
:
"
whisperView
"
...
...
cmd/mist/bindings.go
浏览文件 @
c9985bf5
...
...
@@ -57,7 +57,7 @@ func (gui *Gui) Transact(recipient, value, gas, gasPrice, d string) (string, err
data
=
ethutil
.
Bytes2Hex
(
utils
.
FormatTransactionData
(
d
))
}
return
gui
.
pipe
.
Transact
(
gui
.
privateKey
(),
recipient
,
value
,
gas
,
gasPrice
,
data
)
return
gui
.
xeth
.
Transact
(
gui
.
privateKey
(),
recipient
,
value
,
gas
,
gasPrice
,
data
)
}
func
(
gui
*
Gui
)
SetCustomIdentifier
(
customIdentifier
string
)
{
...
...
cmd/mist/gui.go
浏览文件 @
c9985bf5
...
...
@@ -64,7 +64,7 @@ type Gui struct {
logLevel
logger
.
LogLevel
open
bool
pipe
*
xeth
.
JSXEth
xeth
*
xeth
.
JSXEth
Session
string
clientIdentity
*
p2p
.
SimpleClientIdentity
...
...
@@ -82,8 +82,8 @@ func NewWindow(ethereum *eth.Ethereum, config *ethutil.ConfigManager, clientIden
panic
(
err
)
}
pipe
:=
xeth
.
NewJSXEth
(
ethereum
)
gui
:=
&
Gui
{
eth
:
ethereum
,
txDb
:
db
,
pipe
:
pipe
,
logLevel
:
logger
.
LogLevel
(
logLevel
),
Session
:
session
,
open
:
false
,
clientIdentity
:
clientIdentity
,
config
:
config
,
plugins
:
make
(
map
[
string
]
plugin
)}
xeth
:=
xeth
.
NewJSXEth
(
ethereum
)
gui
:=
&
Gui
{
eth
:
ethereum
,
txDb
:
db
,
xeth
:
xeth
,
logLevel
:
logger
.
LogLevel
(
logLevel
),
Session
:
session
,
open
:
false
,
clientIdentity
:
clientIdentity
,
config
:
config
,
plugins
:
make
(
map
[
string
]
plugin
)}
data
,
_
:=
ethutil
.
ReadAllFile
(
path
.
Join
(
ethutil
.
Config
.
ExecPath
,
"plugins.json"
))
json
.
Unmarshal
([]
byte
(
data
),
&
gui
.
plugins
)
...
...
@@ -228,7 +228,7 @@ func (gui *Gui) setInitialChain(ancientBlocks bool) {
func
(
gui
*
Gui
)
loadAddressBook
()
{
view
:=
gui
.
getObjectByName
(
"infoView"
)
nameReg
:=
gui
.
pipe
.
World
()
.
Config
()
.
Get
(
"NameReg"
)
nameReg
:=
gui
.
xeth
.
World
()
.
Config
()
.
Get
(
"NameReg"
)
if
nameReg
!=
nil
{
it
:=
nameReg
.
Trie
()
.
Iterator
()
for
it
.
Next
()
{
...
...
@@ -243,7 +243,7 @@ func (gui *Gui) loadAddressBook() {
func
(
self
*
Gui
)
loadMergedMiningOptions
()
{
view
:=
self
.
getObjectByName
(
"mergedMiningModel"
)
mergeMining
:=
self
.
pipe
.
World
()
.
Config
()
.
Get
(
"MergeMining"
)
mergeMining
:=
self
.
xeth
.
World
()
.
Config
()
.
Get
(
"MergeMining"
)
if
mergeMining
!=
nil
{
i
:=
0
it
:=
mergeMining
.
Trie
()
.
Iterator
()
...
...
@@ -261,8 +261,7 @@ func (self *Gui) loadMergedMiningOptions() {
}
func
(
gui
*
Gui
)
insertTransaction
(
window
string
,
tx
*
types
.
Transaction
)
{
pipe
:=
xeth
.
New
(
gui
.
eth
)
nameReg
:=
pipe
.
World
()
.
Config
()
.
Get
(
"NameReg"
)
nameReg
:=
gui
.
xeth
.
World
()
.
Config
()
.
Get
(
"NameReg"
)
addr
:=
gui
.
address
()
var
inout
string
...
...
@@ -273,7 +272,7 @@ func (gui *Gui) insertTransaction(window string, tx *types.Transaction) {
}
var
(
ptx
=
xeth
.
NewJSTx
(
tx
,
pipe
.
World
()
.
State
())
ptx
=
xeth
.
NewJSTx
(
tx
,
gui
.
xeth
.
World
()
.
State
())
send
=
nameReg
.
Storage
(
tx
.
From
())
rec
=
nameReg
.
Storage
(
tx
.
To
())
s
,
r
string
...
...
@@ -319,7 +318,7 @@ func (gui *Gui) readPreviousTransactions() {
}
func
(
gui
*
Gui
)
processBlock
(
block
*
types
.
Block
,
initial
bool
)
{
name
:=
strings
.
Trim
(
gui
.
pipe
.
World
()
.
Config
()
.
Get
(
"NameReg"
)
.
Storage
(
block
.
Coinbase
())
.
Str
(),
"
\x00
"
)
name
:=
strings
.
Trim
(
gui
.
xeth
.
World
()
.
Config
()
.
Get
(
"NameReg"
)
.
Storage
(
block
.
Coinbase
())
.
Str
(),
"
\x00
"
)
b
:=
xeth
.
NewJSBlock
(
block
)
b
.
Name
=
name
...
...
@@ -488,7 +487,7 @@ NumGC: %d
func
(
gui
*
Gui
)
setPeerInfo
()
{
gui
.
win
.
Root
()
.
Call
(
"setPeers"
,
fmt
.
Sprintf
(
"%d / %d"
,
gui
.
eth
.
PeerCount
(),
gui
.
eth
.
MaxPeers
))
gui
.
win
.
Root
()
.
Call
(
"resetPeers"
)
for
_
,
peer
:=
range
gui
.
pipe
.
Peers
()
{
for
_
,
peer
:=
range
gui
.
xeth
.
Peers
()
{
gui
.
win
.
Root
()
.
Call
(
"addPeer"
,
peer
)
}
}
...
...
cmd/mist/main.go
浏览文件 @
c9985bf5
...
...
@@ -32,7 +32,7 @@ import (
const
(
ClientIdentifier
=
"Mist"
Version
=
"0.8.
0
"
Version
=
"0.8.
1
"
)
var
ethereum
*
eth
.
Ethereum
...
...
@@ -58,6 +58,7 @@ func run() error {
NATType
:
PMPGateway
,
PMPGateway
:
PMPGateway
,
KeyRing
:
KeyRing
,
Dial
:
true
,
})
if
err
!=
nil
{
mainlogger
.
Fatalln
(
err
)
...
...
pow/ezp/pow.go
浏览文件 @
c9985bf5
...
...
@@ -21,7 +21,7 @@ type EasyPow struct {
}
func
New
()
*
EasyPow
{
return
&
EasyPow
{
turbo
:
tru
e
}
return
&
EasyPow
{
turbo
:
fals
e
}
}
func
(
pow
*
EasyPow
)
GetHashrate
()
int64
{
...
...
xeth/js_types.go
浏览文件 @
c9985bf5
package
xeth
import
(
"fmt"
"strings"
"github.com/ethereum/go-ethereum/core"
...
...
@@ -154,36 +155,24 @@ func NewPReciept(contractCreation bool, creationAddress, hash, address []byte) *
// Peer interface exposed to QML
type
JSPeer
struct
{
ref
*
p2p
.
Peer
// Inbound bool `json:"isInbound"`
// LastSend int64 `json:"lastSend"`
// LastPong int64 `json:"lastPong"`
// Ip string `json:"ip"`
// Port int `json:"port"`
// Version string `json:"version"`
// LastResponse string `json:"lastResponse"`
// Latency string `json:"latency"`
// Caps string `json:"caps"`
ref
*
p2p
.
Peer
Ip
string
`json:"ip"`
Version
string
`json:"version"`
Caps
string
`json:"caps"`
}
func
NewJSPeer
(
peer
*
p2p
.
Peer
)
*
JSPeer
{
var
caps
[]
string
for
_
,
cap
:=
range
peer
.
Caps
()
{
caps
=
append
(
caps
,
fmt
.
Sprintf
(
"%s/%d"
,
cap
.
Name
,
cap
.
Version
))
}
// var ip []string
// for _, i := range peer.Host() {
// ip = append(ip, strconv.Itoa(int(i)))
// }
// ipAddress := strings.Join(ip, ".")
// var caps []string
// capsIt := peer.Caps().NewIterator()
// for capsIt.Next() {
// cap := capsIt.Value().Get(0).Str()
// ver := capsIt.Value().Get(1).Uint()
// caps = append(caps, fmt.Sprintf("%s/%d", cap, ver))
// }
return
&
JSPeer
{
ref
:
peer
}
// return &JSPeer{ref: &peer, Inbound: peer.Inbound(), LastSend: peer.LastSend().Unix(), LastPong: peer.LastPong(), Version: peer.Version(), Ip: ipAddress, Port: int(peer.Port()), Latency: peer.PingTime(), Caps: "[" + strings.Join(caps, ", ") + "]"}
return
&
JSPeer
{
ref
:
peer
,
Ip
:
peer
.
RemoteAddr
()
.
String
(),
Version
:
peer
.
Identity
()
.
String
(),
Caps
:
fmt
.
Sprintf
(
"%v"
,
caps
),
}
}
type
JSReceipt
struct
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录