polish reconnect
This commit is contained in:
parent
e822d57905
commit
3934b750f2
2 changed files with 21 additions and 14 deletions
|
|
@ -165,6 +165,7 @@ Wallet.prototype._optsToObj = function() {
|
|||
spendUnconfirmed: this.spendUnconfirmed,
|
||||
requiredCopayers: this.requiredCopayers,
|
||||
totalCopayers: this.totalCopayers,
|
||||
reconnectDelay: this.reconnectDelay,
|
||||
name: this.name,
|
||||
netKey: this.netKey,
|
||||
version: this.version,
|
||||
|
|
@ -258,12 +259,14 @@ Wallet.prototype.netStart = function() {
|
|||
|
||||
Wallet.prototype.scheduleConnect = function() {
|
||||
var self = this;
|
||||
if (self.network.isOnline()) {
|
||||
self.connectToAll();
|
||||
setTimeout(function() {
|
||||
self.scheduleConnect();
|
||||
},
|
||||
self.reconnectDelay);
|
||||
}
|
||||
}
|
||||
|
||||
Wallet.prototype.getOnlinePeerIDs = function() {
|
||||
return this.network.getOnlinePeerIDs();
|
||||
|
|
|
|||
|
|
@ -313,8 +313,8 @@ Network.prototype.setCopayerId = function(copayerId) {
|
|||
};
|
||||
|
||||
|
||||
Network.prototype.peerFromCopayer = function(hex) {
|
||||
// TODO cache this.
|
||||
Network.prototype.peerFromCopayer = function(hex) {
|
||||
var SIN = bitcore.SIN;
|
||||
return new SIN(new Buffer(hex,'hex')).toString();
|
||||
};
|
||||
|
|
@ -409,6 +409,10 @@ Network.prototype.send = function(copayerIds, payload, cb) {
|
|||
};
|
||||
|
||||
|
||||
Network.prototype.isOnline = function() {
|
||||
return !!this.peer;
|
||||
};
|
||||
|
||||
Network.prototype.connectTo = function(copayerId) {
|
||||
var self = this;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue