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
c9985bf5
Commit
c9985bf5
authored
Jan 05, 2015
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed peer window. Minor tweaks and fixes
parent
22c0c546
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
37 additions
and
53 deletions
+37
-53
main.go
cmd/ethereum/main.go
+1
-1
main.qml
cmd/mist/assets/qml/main.qml
+8
-12
whisper.qml
cmd/mist/assets/qml/views/whisper.qml
+0
-1
bindings.go
cmd/mist/bindings.go
+1
-1
gui.go
cmd/mist/gui.go
+9
-10
main.go
cmd/mist/main.go
+2
-1
pow.go
pow/ezp/pow.go
+1
-1
js_types.go
xeth/js_types.go
+15
-26
No files found.
cmd/ethereum/main.go
View file @
c9985bf5
...
@@ -32,7 +32,7 @@ import (
...
@@ -32,7 +32,7 @@ import (
const
(
const
(
ClientIdentifier
=
"Ethereum(G)"
ClientIdentifier
=
"Ethereum(G)"
Version
=
"0.8.
0
"
Version
=
"0.8.
1
"
)
)
var
clilogger
=
logger
.
NewLogger
(
"CLI"
)
var
clilogger
=
logger
.
NewLogger
(
"CLI"
)
...
...
cmd/mist/assets/qml/main.qml
View file @
c9985bf5
...
@@ -512,18 +512,17 @@ ApplicationWindow {
...
@@ -512,18 +512,17 @@ ApplicationWindow {
var
section
;
var
section
;
switch
(
options
.
section
)
{
switch
(
options
.
section
)
{
case
"ethereum"
:
case
"ethereum"
:
section
=
menuDefault
;
section
=
menuDefault
;
break
;
break
;
case
"legacy"
:
case
"legacy"
:
section
=
menuLegacy
;
section
=
menuLegacy
;
break
;
break
;
default
:
default
:
section
=
menuApps
;
section
=
menuApps
;
break
;
break
;
}
}
var
comp
=
menuItemTemplate
.
createObject
(
section
)
var
comp
=
menuItemTemplate
.
createObject
(
section
)
comp
.
view
=
view
comp
.
view
=
view
comp
.
title
=
view
.
title
comp
.
title
=
view
.
title
...
@@ -771,12 +770,9 @@ ApplicationWindow {
...
@@ -771,12 +770,9 @@ ApplicationWindow {
anchors.fill
:
parent
anchors.fill
:
parent
id
:
peerTable
id
:
peerTable
model
:
peerModel
model
:
peerModel
TableViewColumn
{
width
:
100
;
role
:
"ip"
;
title
:
"IP"
}
TableViewColumn
{
width
:
200
;
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
:
260
;
role
:
"version"
;
title
:
"Version"
}
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
View file @
c9985bf5
...
@@ -10,7 +10,6 @@ import Ethereum 1.0
...
@@ -10,7 +10,6 @@ import Ethereum 1.0
Rectangle
{
Rectangle
{
id
:
root
id
:
root
property
var
title
:
"Whisper Traffic"
property
var
title
:
"Whisper Traffic"
property
var
iconSource
:
"../facet.png"
property
var
menuItem
property
var
menuItem
objectName
:
"whisperView"
objectName
:
"whisperView"
...
...
cmd/mist/bindings.go
View file @
c9985bf5
...
@@ -57,7 +57,7 @@ func (gui *Gui) Transact(recipient, value, gas, gasPrice, d string) (string, err
...
@@ -57,7 +57,7 @@ func (gui *Gui) Transact(recipient, value, gas, gasPrice, d string) (string, err
data
=
ethutil
.
Bytes2Hex
(
utils
.
FormatTransactionData
(
d
))
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
)
{
func
(
gui
*
Gui
)
SetCustomIdentifier
(
customIdentifier
string
)
{
...
...
cmd/mist/gui.go
View file @
c9985bf5
...
@@ -64,7 +64,7 @@ type Gui struct {
...
@@ -64,7 +64,7 @@ type Gui struct {
logLevel
logger
.
LogLevel
logLevel
logger
.
LogLevel
open
bool
open
bool
pipe
*
xeth
.
JSXEth
xeth
*
xeth
.
JSXEth
Session
string
Session
string
clientIdentity
*
p2p
.
SimpleClientIdentity
clientIdentity
*
p2p
.
SimpleClientIdentity
...
@@ -82,8 +82,8 @@ func NewWindow(ethereum *eth.Ethereum, config *ethutil.ConfigManager, clientIden
...
@@ -82,8 +82,8 @@ func NewWindow(ethereum *eth.Ethereum, config *ethutil.ConfigManager, clientIden
panic
(
err
)
panic
(
err
)
}
}
pipe
:=
xeth
.
NewJSXEth
(
ethereum
)
xeth
:=
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
)}
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"
))
data
,
_
:=
ethutil
.
ReadAllFile
(
path
.
Join
(
ethutil
.
Config
.
ExecPath
,
"plugins.json"
))
json
.
Unmarshal
([]
byte
(
data
),
&
gui
.
plugins
)
json
.
Unmarshal
([]
byte
(
data
),
&
gui
.
plugins
)
...
@@ -228,7 +228,7 @@ func (gui *Gui) setInitialChain(ancientBlocks bool) {
...
@@ -228,7 +228,7 @@ func (gui *Gui) setInitialChain(ancientBlocks bool) {
func
(
gui
*
Gui
)
loadAddressBook
()
{
func
(
gui
*
Gui
)
loadAddressBook
()
{
view
:=
gui
.
getObjectByName
(
"infoView"
)
view
:=
gui
.
getObjectByName
(
"infoView"
)
nameReg
:=
gui
.
pipe
.
World
()
.
Config
()
.
Get
(
"NameReg"
)
nameReg
:=
gui
.
xeth
.
World
()
.
Config
()
.
Get
(
"NameReg"
)
if
nameReg
!=
nil
{
if
nameReg
!=
nil
{
it
:=
nameReg
.
Trie
()
.
Iterator
()
it
:=
nameReg
.
Trie
()
.
Iterator
()
for
it
.
Next
()
{
for
it
.
Next
()
{
...
@@ -243,7 +243,7 @@ func (gui *Gui) loadAddressBook() {
...
@@ -243,7 +243,7 @@ func (gui *Gui) loadAddressBook() {
func
(
self
*
Gui
)
loadMergedMiningOptions
()
{
func
(
self
*
Gui
)
loadMergedMiningOptions
()
{
view
:=
self
.
getObjectByName
(
"mergedMiningModel"
)
view
:=
self
.
getObjectByName
(
"mergedMiningModel"
)
mergeMining
:=
self
.
pipe
.
World
()
.
Config
()
.
Get
(
"MergeMining"
)
mergeMining
:=
self
.
xeth
.
World
()
.
Config
()
.
Get
(
"MergeMining"
)
if
mergeMining
!=
nil
{
if
mergeMining
!=
nil
{
i
:=
0
i
:=
0
it
:=
mergeMining
.
Trie
()
.
Iterator
()
it
:=
mergeMining
.
Trie
()
.
Iterator
()
...
@@ -261,8 +261,7 @@ func (self *Gui) loadMergedMiningOptions() {
...
@@ -261,8 +261,7 @@ func (self *Gui) loadMergedMiningOptions() {
}
}
func
(
gui
*
Gui
)
insertTransaction
(
window
string
,
tx
*
types
.
Transaction
)
{
func
(
gui
*
Gui
)
insertTransaction
(
window
string
,
tx
*
types
.
Transaction
)
{
pipe
:=
xeth
.
New
(
gui
.
eth
)
nameReg
:=
gui
.
xeth
.
World
()
.
Config
()
.
Get
(
"NameReg"
)
nameReg
:=
pipe
.
World
()
.
Config
()
.
Get
(
"NameReg"
)
addr
:=
gui
.
address
()
addr
:=
gui
.
address
()
var
inout
string
var
inout
string
...
@@ -273,7 +272,7 @@ func (gui *Gui) insertTransaction(window string, tx *types.Transaction) {
...
@@ -273,7 +272,7 @@ func (gui *Gui) insertTransaction(window string, tx *types.Transaction) {
}
}
var
(
var
(
ptx
=
xeth
.
NewJSTx
(
tx
,
pipe
.
World
()
.
State
())
ptx
=
xeth
.
NewJSTx
(
tx
,
gui
.
xeth
.
World
()
.
State
())
send
=
nameReg
.
Storage
(
tx
.
From
())
send
=
nameReg
.
Storage
(
tx
.
From
())
rec
=
nameReg
.
Storage
(
tx
.
To
())
rec
=
nameReg
.
Storage
(
tx
.
To
())
s
,
r
string
s
,
r
string
...
@@ -319,7 +318,7 @@ func (gui *Gui) readPreviousTransactions() {
...
@@ -319,7 +318,7 @@ func (gui *Gui) readPreviousTransactions() {
}
}
func
(
gui
*
Gui
)
processBlock
(
block
*
types
.
Block
,
initial
bool
)
{
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
:=
xeth
.
NewJSBlock
(
block
)
b
.
Name
=
name
b
.
Name
=
name
...
@@ -488,7 +487,7 @@ NumGC: %d
...
@@ -488,7 +487,7 @@ NumGC: %d
func
(
gui
*
Gui
)
setPeerInfo
()
{
func
(
gui
*
Gui
)
setPeerInfo
()
{
gui
.
win
.
Root
()
.
Call
(
"setPeers"
,
fmt
.
Sprintf
(
"%d / %d"
,
gui
.
eth
.
PeerCount
(),
gui
.
eth
.
MaxPeers
))
gui
.
win
.
Root
()
.
Call
(
"setPeers"
,
fmt
.
Sprintf
(
"%d / %d"
,
gui
.
eth
.
PeerCount
(),
gui
.
eth
.
MaxPeers
))
gui
.
win
.
Root
()
.
Call
(
"resetPeers"
)
gui
.
win
.
Root
()
.
Call
(
"resetPeers"
)
for
_
,
peer
:=
range
gui
.
pipe
.
Peers
()
{
for
_
,
peer
:=
range
gui
.
xeth
.
Peers
()
{
gui
.
win
.
Root
()
.
Call
(
"addPeer"
,
peer
)
gui
.
win
.
Root
()
.
Call
(
"addPeer"
,
peer
)
}
}
}
}
...
...
cmd/mist/main.go
View file @
c9985bf5
...
@@ -32,7 +32,7 @@ import (
...
@@ -32,7 +32,7 @@ import (
const
(
const
(
ClientIdentifier
=
"Mist"
ClientIdentifier
=
"Mist"
Version
=
"0.8.
0
"
Version
=
"0.8.
1
"
)
)
var
ethereum
*
eth
.
Ethereum
var
ethereum
*
eth
.
Ethereum
...
@@ -58,6 +58,7 @@ func run() error {
...
@@ -58,6 +58,7 @@ func run() error {
NATType
:
PMPGateway
,
NATType
:
PMPGateway
,
PMPGateway
:
PMPGateway
,
PMPGateway
:
PMPGateway
,
KeyRing
:
KeyRing
,
KeyRing
:
KeyRing
,
Dial
:
true
,
})
})
if
err
!=
nil
{
if
err
!=
nil
{
mainlogger
.
Fatalln
(
err
)
mainlogger
.
Fatalln
(
err
)
...
...
pow/ezp/pow.go
View file @
c9985bf5
...
@@ -21,7 +21,7 @@ type EasyPow struct {
...
@@ -21,7 +21,7 @@ type EasyPow struct {
}
}
func
New
()
*
EasyPow
{
func
New
()
*
EasyPow
{
return
&
EasyPow
{
turbo
:
tru
e
}
return
&
EasyPow
{
turbo
:
fals
e
}
}
}
func
(
pow
*
EasyPow
)
GetHashrate
()
int64
{
func
(
pow
*
EasyPow
)
GetHashrate
()
int64
{
...
...
xeth/js_types.go
View file @
c9985bf5
package
xeth
package
xeth
import
(
import
(
"fmt"
"strings"
"strings"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core"
...
@@ -154,36 +155,24 @@ func NewPReciept(contractCreation bool, creationAddress, hash, address []byte) *
...
@@ -154,36 +155,24 @@ func NewPReciept(contractCreation bool, creationAddress, hash, address []byte) *
// Peer interface exposed to QML
// Peer interface exposed to QML
type
JSPeer
struct
{
type
JSPeer
struct
{
ref
*
p2p
.
Peer
ref
*
p2p
.
Peer
// Inbound bool `json:"isInbound"`
Ip
string
`json:"ip"`
// LastSend int64 `json:"lastSend"`
Version
string
`json:"version"`
// LastPong int64 `json:"lastPong"`
Caps
string
`json:"caps"`
// Ip string `json:"ip"`
// Port int `json:"port"`
// Version string `json:"version"`
// LastResponse string `json:"lastResponse"`
// Latency string `json:"latency"`
// Caps string `json:"caps"`
}
}
func
NewJSPeer
(
peer
*
p2p
.
Peer
)
*
JSPeer
{
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
return
&
JSPeer
{
// for _, i := range peer.Host() {
ref
:
peer
,
// ip = append(ip, strconv.Itoa(int(i)))
Ip
:
peer
.
RemoteAddr
()
.
String
(),
// }
Version
:
peer
.
Identity
()
.
String
(),
// ipAddress := strings.Join(ip, ".")
Caps
:
fmt
.
Sprintf
(
"%v"
,
caps
),
}
// 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, ", ") + "]"}
}
}
type
JSReceipt
struct
{
type
JSReceipt
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