http/miner: misc fixes.

This commit is contained in:
Christopher Jeffrey 2016-10-06 02:25:15 -07:00
parent 97c89303ba
commit 3cc5ce16b9
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD
2 changed files with 6 additions and 6 deletions

View File

@ -107,12 +107,7 @@ HTTPClient.prototype._open = co(function* _open() {
});
this.socket.on('wallet balance', function(balance) {
self.emit('balance', {
id: balance.id,
confirmed: utils.satoshi(balance.confirmed),
unconfirmed: utils.satoshi(balance.unconfirmed),
total: utils.satoshi(balance.total)
});
self.emit('balance', balance);
});
yield this._onConnect();

View File

@ -121,6 +121,7 @@ Miner.prototype._close = co(function* close() {
*/
Miner.prototype.start = co(function* start() {
var self = this;
var block;
assert(!this.running, 'Miner is already running.');
@ -143,6 +144,10 @@ Miner.prototype.start = co(function* start() {
if (this.stopping)
break;
this.attempt.on('status', function(status) {
self.emit('status', status);
});
try {
block = yield this.attempt.mineAsync();
} catch (e) {