remove commented-out references to obsolete netKey
This commit is contained in:
parent
bf36376dda
commit
b9ecab9b92
3 changed files with 2 additions and 35 deletions
|
|
@ -38,7 +38,6 @@ function Wallet(opts) {
|
||||||
|
|
||||||
this.id = opts.id || Wallet.getRandomId();
|
this.id = opts.id || Wallet.getRandomId();
|
||||||
this.name = opts.name;
|
this.name = opts.name;
|
||||||
//this.netKey = opts.netKey || SecureRandom.getRandomBuffer(8).toString('base64');
|
|
||||||
|
|
||||||
// Renew token every 24hs
|
// Renew token every 24hs
|
||||||
if (opts.tokenTime && new Date().getTime() - opts.tokenTime < 86400000) {
|
if (opts.tokenTime && new Date().getTime() - opts.tokenTime < 86400000) {
|
||||||
|
|
@ -216,7 +215,6 @@ Wallet.prototype._optsToObj = function() {
|
||||||
requiredCopayers: this.requiredCopayers,
|
requiredCopayers: this.requiredCopayers,
|
||||||
totalCopayers: this.totalCopayers,
|
totalCopayers: this.totalCopayers,
|
||||||
name: this.name,
|
name: this.name,
|
||||||
//netKey: this.netKey,
|
|
||||||
version: this.version,
|
version: this.version,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -241,8 +239,6 @@ Wallet.prototype.getMyCopayerId = function() {
|
||||||
|
|
||||||
Wallet.prototype.getSecret = function() {
|
Wallet.prototype.getSecret = function() {
|
||||||
var pubkeybuf = new Buffer(this.getMyCopayerId(), 'hex');
|
var pubkeybuf = new Buffer(this.getMyCopayerId(), 'hex');
|
||||||
//var k = new Buffer(this.netKey, 'base64');
|
|
||||||
//var b = Buffer.concat([i, k]);
|
|
||||||
var str = Base58Check.encode(pubkeybuf);
|
var str = Base58Check.encode(pubkeybuf);
|
||||||
return str;
|
return str;
|
||||||
};
|
};
|
||||||
|
|
@ -250,11 +246,9 @@ Wallet.prototype.getSecret = function() {
|
||||||
|
|
||||||
Wallet.decodeSecret = function(secretB) {
|
Wallet.decodeSecret = function(secretB) {
|
||||||
var secret = Base58Check.decode(secretB);
|
var secret = Base58Check.decode(secretB);
|
||||||
//var netKeyBuf = secret.slice(-8);
|
|
||||||
var pubKeyBuf = secret.slice(0, 33);
|
var pubKeyBuf = secret.slice(0, 33);
|
||||||
return {
|
return {
|
||||||
pubKey: pubKeyBuf.toString('hex')//,
|
pubKey: pubKeyBuf.toString('hex')
|
||||||
//netKey: netKeyBuf.toString('base64'),
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -280,8 +274,7 @@ Wallet.prototype.netStart = function() {
|
||||||
var startOpts = {
|
var startOpts = {
|
||||||
copayerId: myId,
|
copayerId: myId,
|
||||||
token: self.token,
|
token: self.token,
|
||||||
maxPeers: self.totalCopayers//,
|
maxPeers: self.totalCopayers
|
||||||
//netKey: this.netKey,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if (this.publicKeyRing.isComplete()) {
|
if (this.publicKeyRing.isComplete()) {
|
||||||
|
|
|
||||||
|
|
@ -220,7 +220,6 @@ WalletFactory.prototype.joinCreateSession = function(secret, nickname, passphras
|
||||||
this.log('\t### PrivateKey Initialized');
|
this.log('\t### PrivateKey Initialized');
|
||||||
var opts = {
|
var opts = {
|
||||||
copayerId: privateKey.getId(),
|
copayerId: privateKey.getId(),
|
||||||
//netKey: s.netKey,
|
|
||||||
privkey: privateKey.getIdPriv()
|
privkey: privateKey.getIdPriv()
|
||||||
};
|
};
|
||||||
self.network.cleanUp();
|
self.network.cleanUp();
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,6 @@ Network.prototype.cleanUp = function() {
|
||||||
this.started = false;
|
this.started = false;
|
||||||
this.connectedPeers = [];
|
this.connectedPeers = [];
|
||||||
this.peerId = null;
|
this.peerId = null;
|
||||||
//this.netKey = null;
|
|
||||||
this.privkey = null; //TODO: hide privkey in a closure
|
this.privkey = null; //TODO: hide privkey in a closure
|
||||||
this.copayerId = null;
|
this.copayerId = null;
|
||||||
this.signingKey = null;
|
this.signingKey = null;
|
||||||
|
|
@ -305,7 +304,6 @@ Network.prototype.start = function(opts, openCallback) {
|
||||||
|
|
||||||
if (this.started) return openCallback();
|
if (this.started) return openCallback();
|
||||||
|
|
||||||
//this.netKey = opts.netKey;
|
|
||||||
this.privkey = opts.privkey;
|
this.privkey = opts.privkey;
|
||||||
this.maxPeers = opts.maxPeers || this.maxPeers;
|
this.maxPeers = opts.maxPeers || this.maxPeers;
|
||||||
|
|
||||||
|
|
@ -353,34 +351,12 @@ Network.prototype.getPeer = function() {
|
||||||
Network.prototype._encrypt = function(pubkey, payload) {
|
Network.prototype._encrypt = function(pubkey, payload) {
|
||||||
var encrypted = bitcore.ECIES.encrypt(pubkey, payload);
|
var encrypted = bitcore.ECIES.encrypt(pubkey, payload);
|
||||||
return encrypted;
|
return encrypted;
|
||||||
|
|
||||||
/*
|
|
||||||
var plainText = sjcl.codec.utf8String.toBits(payloadStr);
|
|
||||||
var p = this.sjclParams;
|
|
||||||
ct = sjcl.encrypt(this.netKey, plainText, p);//,p, rp);
|
|
||||||
var c = JSON.parse(ct);
|
|
||||||
var toSend = {
|
|
||||||
iv: c.iv,
|
|
||||||
ct: c.ct,
|
|
||||||
};
|
|
||||||
return JSON.stringify(toSend);
|
|
||||||
*/
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
Network.prototype._decrypt = function(privkey, encrypted) {
|
Network.prototype._decrypt = function(privkey, encrypted) {
|
||||||
var decrypted = bitcore.ECIES.decrypt(privkey, encrypted);
|
var decrypted = bitcore.ECIES.decrypt(privkey, encrypted);
|
||||||
return decrypted;
|
return decrypted;
|
||||||
|
|
||||||
/*
|
|
||||||
var i = JSON.parse(encStr);
|
|
||||||
for (var k in this.sjclParams) {
|
|
||||||
i[k] = this.sjclParams[k];
|
|
||||||
}
|
|
||||||
var str= JSON.stringify(i);
|
|
||||||
var pt = sjcl.decrypt(this.netKey, str);
|
|
||||||
return pt;
|
|
||||||
*/
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Network.prototype._sendToOne = function(copayerId, payload, sig, cb) {
|
Network.prototype._sendToOne = function(copayerId, payload, sig, cb) {
|
||||||
|
|
@ -395,7 +371,6 @@ Network.prototype._sendToOne = function(copayerId, payload, sig, cb) {
|
||||||
};
|
};
|
||||||
|
|
||||||
Network.prototype.send = function(copayerIds, payload, cb) {
|
Network.prototype.send = function(copayerIds, payload, cb) {
|
||||||
//if (!payload || !this.netKey) return cb();
|
|
||||||
if (!payload) return cb();
|
if (!payload) return cb();
|
||||||
|
|
||||||
var self=this;
|
var self=this;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue