diff --git a/.babelrc b/.babelrc index 347c05d9..0ee666f6 100644 --- a/.babelrc +++ b/.babelrc @@ -7,12 +7,5 @@ "useBuiltins": "usage", "loose": true }] - ], - "plugins": [ - ["transform-runtime", { - "helpers": true, - "polyfill": true, - "regenerator": true - }] ] } diff --git a/browser/src/app.js b/browser/src/app.js index ccec2531..c72caddf 100644 --- a/browser/src/app.js +++ b/browser/src/app.js @@ -64,13 +64,16 @@ const node = new FullNode({ workers: true, workerFile: '/worker.js', createSocket: (port, host) => { - return ProxySocket.connect('ws://127.0.0.1:8080', port, host); + const proto = global.location.protocol === 'https:' ? 'wss' : 'ws'; + const hostname = global.location.host; + return ProxySocket.connect(`${proto}://${hostname}`, port, host); }, logger: logger, plugins: [plugin] }); const {wdb} = node.require('walletdb'); +wdb.options.witness = true; window.onunhandledrejection = function onunhandledrejection(event) { throw event.reason; @@ -86,6 +89,11 @@ floating.onmouseup = function onmouseup(ev) { }; function show(obj) { + if (obj instanceof Error) { + floating.innerHTML = obj.stack; + floating.style.display = 'block'; + return; + } const json = obj && obj.toJSON ? obj.toJSON() : null; floating.innerHTML = escape(JSON.stringify(json, null, 2)); floating.style.display = 'block'; diff --git a/lib/wallet/account.js b/lib/wallet/account.js index 91ae80b2..ae72b7df 100644 --- a/lib/wallet/account.js +++ b/lib/wallet/account.js @@ -382,7 +382,7 @@ class Account { throw new Error(`Bad branch: ${branch}.`); } - this.save(); + this.save(b); return key; } @@ -961,8 +961,8 @@ Account.types = { */ Account.typesByVal = [ - 'pubkeyhash', - 'multisig' + 'PUBKEYHASH', + 'MULTISIG' ]; /** diff --git a/package.json b/package.json index fcadf8bc..fad724d5 100644 --- a/package.json +++ b/package.json @@ -23,27 +23,27 @@ "node": ">=7.6.0" }, "dependencies": { - "bclient": "^0.0.0", - "bcfg": "^0.0.0", - "bcrypto": "^0.0.0", - "bdb": "^0.0.0", - "bdns": "^0.0.0", - "bevent": "^0.0.0", - "bfile": "^0.0.0", - "bfilter": "^0.0.0", - "binet": "^0.0.0", - "blgr": "^0.0.0", - "bmutex": "^0.0.0", - "bn.js": "^4.11.8", - "bsock": "^0.0.0", - "bsocks": "^0.0.0", - "bstring": "^0.0.0", - "btcp": "^0.0.0", - "bufio": "^0.0.0", - "bupnp": "^0.0.0", - "bval": "^0.0.0", - "bweb": "^0.0.0", - "n64": "^0.0.18" + "bcfg": "~0.0.0", + "bclient": "~0.0.0", + "bcrypto": "~0.0.0", + "bdb": "~0.0.0", + "bdns": "~0.0.0", + "bevent": "~0.0.0", + "bfile": "~0.0.0", + "bfilter": "~0.0.0", + "binet": "~0.0.0", + "blgr": "~0.0.0", + "bmutex": "~0.0.0", + "bn.js": "~4.11.8", + "bsock": "~0.0.0", + "bsocks": "~0.0.0", + "bstring": "~0.0.0", + "btcp": "~0.0.0", + "bufio": "~0.0.0", + "bupnp": "~0.0.0", + "bval": "~0.0.0", + "bweb": "~0.0.0", + "n64": "~0.1.0" }, "devDependencies": { "babel-core": "^6.26.0",