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) {
|
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();
|
||||||
|
|||||||
@ -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) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user