Skip to content

Commit

Permalink
Merge branch 'release/0.6.8'
Browse files Browse the repository at this point in the history
  • Loading branch information
obscuren committed Oct 7, 2014
2 parents bd95fd7 + a9b8577 commit d1a6084
Show file tree
Hide file tree
Showing 9 changed files with 1,134 additions and 956 deletions.
62 changes: 34 additions & 28 deletions ethereum/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,36 +10,41 @@ import (
"github.com/ethereum/eth-go/ethlog"
)

var Identifier string
var KeyRing string
var DiffTool bool
var DiffType string
var KeyStore string
var StartRpc bool
var RpcPort int
var UseUPnP bool
var OutboundPort string
var ShowGenesis bool
var AddPeer string
var MaxPeer int
var GenAddr bool
var UseSeed bool
var SecretFile string
var ExportDir string
var NonInteractive bool
var Datadir string
var LogFile string
var ConfigFile string
var DebugFile string
var LogLevel int
var Dump bool
var DumpHash string
var DumpNumber int
var (
Identifier string
KeyRing string
DiffTool bool
DiffType string
KeyStore string
StartRpc bool
StartWebSockets bool
RpcPort int
UseUPnP bool
OutboundPort string
ShowGenesis bool
AddPeer string
MaxPeer int
GenAddr bool
UseSeed bool
SecretFile string
ExportDir string
NonInteractive bool
Datadir string
LogFile string
ConfigFile string
DebugFile string
LogLevel int
Dump bool
DumpHash string
DumpNumber int
)

// flags specific to cli client
var StartMining bool
var StartJsConsole bool
var InputFile string
var (
StartMining bool
StartJsConsole bool
InputFile string
)

func defaultDataDir() string {
usr, _ := user.Current()
Expand All @@ -62,6 +67,7 @@ func Init() {
flag.IntVar(&MaxPeer, "maxpeer", 10, "maximum desired peers")
flag.IntVar(&RpcPort, "rpcport", 8080, "port to start json-rpc server on")
flag.BoolVar(&StartRpc, "rpc", false, "start rpc server")
flag.BoolVar(&StartWebSockets, "ws", false, "start websocket server")
flag.BoolVar(&NonInteractive, "y", false, "non-interactive mode (say yes to confirmations)")
flag.BoolVar(&UseSeed, "seed", true, "seed peers")
flag.BoolVar(&GenAddr, "genaddr", false, "create a new priv/pub key")
Expand Down
4 changes: 4 additions & 0 deletions ethereum/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ func main() {
utils.StartRpc(ethereum, RpcPort)
}

if StartWebSockets {
utils.StartWebSockets(ethereum)
}

utils.StartEthereum(ethereum, UseSeed)

// this blocks the thread
Expand Down
28 changes: 5 additions & 23 deletions mist/assets/ext/html_messaging.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
// The magic return variable. The magic return variable will be set during the execution of the QML call.
(function(window) {
function message(type, data) {
document.title = JSON.stringify({type: type, data: data});

return window.____returnData;
var Promise = window.Promise;
if(typeof(Promise) === "undefined") {
var Promise = Q.Promise;
}

function isPromise(o) {
Expand Down Expand Up @@ -446,6 +445,7 @@
}
});


var g_seed = 1;
function postData(data, cb) {
data._seed = g_seed;
Expand All @@ -459,24 +459,6 @@

g_seed++;

navigator.qt.postMessage(JSON.stringify(data));
}

navigator.qt.onmessage = function(ev) {
var data = JSON.parse(ev.data)

if(data._event !== undefined) {
eth.trigger(data._event, data.data);
} else {
if(data._seed) {
var cb = eth._callbacks[data._seed];
if(cb) {
cb.call(this, data.data)

// Remove the "trigger" callback
delete eth._callbacks[ev._seed];
}
}
}
window._messagingAdapter.call(this, JSON.stringify(data))
}
})(this);
3 changes: 0 additions & 3 deletions mist/assets/ext/pre.js

This file was deleted.

21 changes: 21 additions & 0 deletions mist/assets/ext/qt_messaging_adapter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
window._messagingAdapter = function(data) {
navigator.qt.postMessage(data);
};

navigator.qt.onmessage = function(ev) {
var data = JSON.parse(ev.data)

if(data._event !== undefined) {
eth.trigger(data._event, data.data);
} else {
if(data._seed) {
var cb = eth._callbacks[data._seed];
if(cb) {
cb.call(this, data.data)

// Remove the "trigger" callback
delete eth._callbacks[ev._seed];
}
}
}
}
Loading

0 comments on commit d1a6084

Please sign in to comment.