move chain.on("fork") somewhere sane.
This commit is contained in:
parent
1a6633bade
commit
d3811acc28
@ -159,6 +159,15 @@ Pool.prototype._init = function _init() {
|
|||||||
self._loadRange(preload);
|
self._loadRange(preload);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.chain.on('fork', function(height, hash, checkpoint) {
|
||||||
|
var peer = self.syncPeer;
|
||||||
|
if (!peer)
|
||||||
|
return;
|
||||||
|
delete self.syncPeer;
|
||||||
|
peer.destroy();
|
||||||
|
self.startSync();
|
||||||
|
});
|
||||||
|
|
||||||
this.options.wallets.forEach(function(w) {
|
this.options.wallets.forEach(function(w) {
|
||||||
self.addWallet(w);
|
self.addWallet(w);
|
||||||
});
|
});
|
||||||
@ -428,15 +437,6 @@ Pool.prototype._addPeer = function _addPeer(backoff) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
this.chain.on('fork', function(height, hash, checkpoint) {
|
|
||||||
var peer = self.syncPeer;
|
|
||||||
if (!peer)
|
|
||||||
return;
|
|
||||||
delete self.syncPeer;
|
|
||||||
peer.destroy();
|
|
||||||
self.startSync();
|
|
||||||
});
|
|
||||||
|
|
||||||
// Just FYI
|
// Just FYI
|
||||||
peer.on('reject', function(payload) {
|
peer.on('reject', function(payload) {
|
||||||
self.emit('reject', payload, peer);
|
self.emit('reject', payload, peer);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user