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) { this.socket.on('wallet balance', function(balance) {
self.emit('balance', { self.emit('balance', balance);
id: balance.id,
confirmed: utils.satoshi(balance.confirmed),
unconfirmed: utils.satoshi(balance.unconfirmed),
total: utils.satoshi(balance.total)
});
}); });
yield this._onConnect(); yield this._onConnect();

View File

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