Skip to content

Commit 0006585

Browse files
committed
Merge branch 'develop' of github.com-obscure:ethereum/go-ethereum into develop
2 parents fa4cbad + 639ac5c commit 0006585

File tree

19 files changed

+658
-662
lines changed

19 files changed

+658
-662
lines changed

cmd/ethereum/main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ func main() {
6767
DataDir: Datadir,
6868
LogFile: LogFile,
6969
LogLevel: LogLevel,
70+
LogFormat: LogFormat,
7071
MaxPeers: MaxPeer,
7172
Port: OutboundPort,
7273
NAT: NAT,

cmd/mist/assets/ext/mist.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,18 @@
2020
console.log("loaded?");
2121

2222
document.onkeydown = function(evt) {
23+
// This functions keeps track of keyboard inputs in order to allow copy, paste and other features
24+
2325
evt = evt || window.event;
2426
if (evt.ctrlKey && evt.keyCode == 67) {
2527
window.document.execCommand("copy");
26-
console.log("Ctrl-C");
2728
} else if (evt.ctrlKey && evt.keyCode == 88) {
2829
window.document.execCommand("cut");
29-
console.log("Ctrl-X");
30-
} if (evt.ctrlKey && evt.keyCode == 86) {
31-
console.log("Ctrl-V");
32-
} if (evt.ctrlKey && evt.keyCode == 90) {
33-
console.log("Ctrl-Z");
30+
} else if (evt.ctrlKey && evt.keyCode == 86) {
31+
window.document.execCommand("paste");
32+
} else if (evt.ctrlKey && evt.keyCode == 90) {
33+
window.document.execCommand("undo");
34+
} else if (evt.ctrlKey && evt.shiftKey && evt.keyCode == 90) {
35+
window.document.execCommand("redo");
3436
}
3537
};

cmd/mist/assets/qml/main.qml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,11 @@ ApplicationWindow {
131131
var existingDomain = matches && matches[1];
132132
if (requestedDomain == existingDomain) {
133133
domainAlreadyOpen = true;
134-
mainSplit.views[i].view.url = url;
134+
135+
if (mainSplit.views[i].view.url != url){
136+
mainSplit.views[i].view.url = url;
137+
}
138+
135139
activeView(mainSplit.views[i].view, mainSplit.views[i].menuItem);
136140
}
137141
}
@@ -928,7 +932,8 @@ ApplicationWindow {
928932
model: peerModel
929933
TableViewColumn{width: 180; role: "addr" ; title: "Remote Address" }
930934
TableViewColumn{width: 280; role: "nodeID" ; title: "Node ID" }
931-
TableViewColumn{width: 180; role: "caps" ; title: "Capabilities" }
935+
TableViewColumn{width: 100; role: "name" ; title: "Name" }
936+
TableViewColumn{width: 40; role: "caps" ; title: "Capabilities" }
932937
}
933938
}
934939
}

cmd/mist/assets/qml/views/browser.qml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import QtQuick.Controls 1.0;
33
import QtQuick.Controls.Styles 1.0
44
import QtQuick.Layouts 1.0;
55
import QtWebEngine 1.0
6-
//import QtWebEngine.experimental 1.0
6+
import QtWebEngine.experimental 1.0
77
import QtQuick.Window 2.0;
88

99
Rectangle {
@@ -340,7 +340,7 @@ Rectangle {
340340
WebEngineView {
341341
objectName: "webView"
342342
id: webview
343-
//experimental.settings.javascriptCanAccessClipboard: true
343+
experimental.settings.javascriptCanAccessClipboard: true
344344
//experimental.settings.localContentCanAccessRemoteUrls: true
345345
anchors {
346346
left: parent.left
@@ -399,7 +399,8 @@ Rectangle {
399399

400400
onLoadingChanged: {
401401
if (loadRequest.status == WebEngineView.LoadSucceededStatus) {
402-
webview.runJavaScript("document.title", function(pageTitle) {
402+
403+
webview.runJavaScript("document.title", function(pageTitle) {
403404
menuItem.title = pageTitle;
404405
});
405406

@@ -441,7 +442,8 @@ Rectangle {
441442

442443
webview.runJavaScript(eth.readFile("bignumber.min.js"));
443444
webview.runJavaScript(eth.readFile("ethereum.js/dist/ethereum.js"));
444-
445+
webview.runJavaScript(eth.readFile("mist.js"));
446+
445447
var cleanTitle = webview.url.toString()
446448
var matches = cleanTitle.match(/^[a-z]*\:\/\/([^\/?#]+)(?:[\/?#]|$)/i);
447449
var domain = matches && matches[1];

cmd/mist/assets/qml/views/catalog.qml

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import QtQuick.Controls 1.0;
33
import QtQuick.Controls.Styles 1.0
44
import QtQuick.Layouts 1.0;
55
import QtWebEngine 1.0
6-
//import QtWebEngine.experimental 1.0
6+
import QtWebEngine.experimental 1.0
77
import QtQuick.Window 2.0;
88

99

@@ -21,8 +21,6 @@ Rectangle {
2121
property alias windowTitle: webview.title
2222
property alias webView: webview
2323

24-
25-
2624
property var cleanPath: false
2725
property var open: function(url) {
2826
if(!window.cleanPath) {
@@ -66,9 +64,6 @@ Rectangle {
6664
}
6765
}
6866

69-
Component.onCompleted: {
70-
}
71-
7267
Item {
7368
objectName: "root"
7469
id: root
@@ -85,7 +80,7 @@ Rectangle {
8580
property var domain: "ethereum-dapp-catalog.meteor.com"
8681
url: protocol + domain
8782

88-
//experimental.settings.javascriptCanAccessClipboard: true
83+
experimental.settings.javascriptCanAccessClipboard: true
8984

9085

9186
onJavaScriptConsoleMessage: {
@@ -112,11 +107,11 @@ Rectangle {
112107

113108
}
114109
}
115-
// onLoadingChanged: {
116-
// if (loadRequest.status == WebEngineView.LoadSucceededStatus) {
117-
// webview.runJavaScript(eth.readFile("mist.js"));
118-
// }
119-
// }
110+
onLoadingChanged: {
111+
if (loadRequest.status == WebEngineView.LoadSucceededStatus) {
112+
webview.runJavaScript(eth.readFile("mist.js"));
113+
}
114+
}
120115
}
121116

122117

cmd/mist/flags.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ var (
6363
DebugFile string
6464
LogLevel int
6565
VmType int
66+
MinerThreads int
6667
)
6768

6869
// flags specific to gui client
@@ -137,6 +138,8 @@ func Init() {
137138
flag.StringVar(&BootNodes, "bootnodes", "", "space-separated node URLs for discovery bootstrap")
138139
flag.IntVar(&MaxPeer, "maxpeer", 30, "maximum desired peers")
139140

141+
flag.IntVar(&MinerThreads, "minerthreads", runtime.NumCPU(), "number of miner threads")
142+
140143
flag.Parse()
141144

142145
var err error

cmd/mist/gui.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ NumGC: %d
453453
))
454454
}
455455

456-
type qmlpeer struct{ Addr, NodeID, Caps string }
456+
type qmlpeer struct{ Addr, NodeID, Name, Caps string }
457457

458458
type peersByID []*qmlpeer
459459

@@ -468,6 +468,7 @@ func (gui *Gui) setPeerInfo() {
468468
qpeers[i] = &qmlpeer{
469469
NodeID: p.ID().String(),
470470
Addr: p.RemoteAddr().String(),
471+
Name: p.Name(),
471472
Caps: fmt.Sprint(p.Caps()),
472473
}
473474
}

cmd/mist/main.go

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -52,19 +52,20 @@ func run() error {
5252
config := utils.InitConfig(VmType, ConfigFile, Datadir, "ETH")
5353

5454
ethereum, err := eth.New(&eth.Config{
55-
Name: p2p.MakeName(ClientIdentifier, Version),
56-
KeyStore: KeyStore,
57-
DataDir: Datadir,
58-
LogFile: LogFile,
59-
LogLevel: LogLevel,
60-
MaxPeers: MaxPeer,
61-
Port: OutboundPort,
62-
NAT: NAT,
63-
Shh: true,
64-
BootNodes: BootNodes,
65-
NodeKey: NodeKey,
66-
KeyRing: KeyRing,
67-
Dial: true,
55+
Name: p2p.MakeName(ClientIdentifier, Version),
56+
KeyStore: KeyStore,
57+
DataDir: Datadir,
58+
LogFile: LogFile,
59+
LogLevel: LogLevel,
60+
MaxPeers: MaxPeer,
61+
Port: OutboundPort,
62+
NAT: NAT,
63+
Shh: true,
64+
BootNodes: BootNodes,
65+
NodeKey: NodeKey,
66+
KeyRing: KeyRing,
67+
Dial: true,
68+
MinerThreads: MinerThreads,
6869
})
6970
if err != nil {
7071
mainlogger.Fatalln(err)

cmd/utils/cmd.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ func StartMining(ethereum *eth.Ethereum) bool {
225225
go func() {
226226
clilogger.Infoln("Start mining")
227227
if gminer == nil {
228-
gminer = miner.New(addr, ethereum)
228+
gminer = miner.New(addr, ethereum, 4)
229229
}
230230
gminer.Start()
231231
}()

eth/backend.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ type Config struct {
5353
Shh bool
5454
Dial bool
5555

56+
MinerThreads int
57+
5658
KeyManager *crypto.KeyManager
5759
}
5860

@@ -153,7 +155,7 @@ func New(config *Config) (*Ethereum, error) {
153155
eth.blockProcessor = core.NewBlockProcessor(db, eth.txPool, eth.chainManager, eth.EventMux())
154156
eth.chainManager.SetProcessor(eth.blockProcessor)
155157
eth.whisper = whisper.New()
156-
eth.miner = miner.New(keyManager.Address(), eth)
158+
eth.miner = miner.New(keyManager.Address(), eth, config.MinerThreads)
157159

158160
hasBlock := eth.chainManager.HasBlock
159161
insertChain := eth.chainManager.InsertChain
@@ -209,9 +211,7 @@ func (s *Ethereum) Coinbase() []byte { return nil } // TODO
209211
func (s *Ethereum) Start() error {
210212
jsonlogger.LogJson(&ethlogger.LogStarting{
211213
ClientString: s.net.Name,
212-
Coinbase: ethutil.Bytes2Hex(s.KeyManager().Address()),
213214
ProtocolVersion: ProtocolVersion,
214-
LogEvent: ethlogger.LogEvent{Guid: ethutil.Bytes2Hex(crypto.FromECDSAPub(&s.net.PrivateKey.PublicKey))},
215215
})
216216

217217
err := s.net.Start()

0 commit comments

Comments
 (0)