http/miner: misc fixes.
This commit is contained in:
parent
97c89303ba
commit
3cc5ce16b9
@ -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();
|
||||
|
||||
@ -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) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user