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.name = opts.name;
|
||||
//this.netKey = opts.netKey || SecureRandom.getRandomBuffer(8).toString('base64');
|
||||
|
||||
// Renew token every 24hs
|
||||
if (opts.tokenTime && new Date().getTime() - opts.tokenTime < 86400000) {
|
||||
|
|
@ -216,7 +215,6 @@ Wallet.prototype._optsToObj = function() {
|
|||
requiredCopayers: this.requiredCopayers,
|
||||
totalCopayers: this.totalCopayers,
|
||||
name: this.name,
|
||||
//netKey: this.netKey,
|
||||
version: this.version,
|
||||
};
|
||||
|
||||
|
|
@ -241,8 +239,6 @@ Wallet.prototype.getMyCopayerId = function() {
|
|||
|
||||
Wallet.prototype.getSecret = function() {
|
||||
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);
|
||||
return str;
|
||||
};
|
||||
|
|
@ -250,11 +246,9 @@ Wallet.prototype.getSecret = function() {
|
|||
|
||||
Wallet.decodeSecret = function(secretB) {
|
||||
var secret = Base58Check.decode(secretB);
|
||||
//var netKeyBuf = secret.slice(-8);
|
||||
var pubKeyBuf = secret.slice(0, 33);
|
||||
return {
|
||||
pubKey: pubKeyBuf.toString('hex')//,
|
||||
//netKey: netKeyBuf.toString('base64'),
|
||||
pubKey: pubKeyBuf.toString('hex')
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -280,8 +274,7 @@ Wallet.prototype.netStart = function() {
|
|||
var startOpts = {
|
||||
copayerId: myId,
|
||||
token: self.token,
|
||||
maxPeers: self.totalCopayers//,
|
||||
//netKey: this.netKey,
|
||||
maxPeers: self.totalCopayers
|
||||
};
|
||||
|
||||
if (this.publicKeyRing.isComplete()) {
|
||||
|
|
|
|||
|
|
@ -220,7 +220,6 @@ WalletFactory.prototype.joinCreateSession = function(secret, nickname, passphras
|
|||
this.log('\t### PrivateKey Initialized');
|
||||
var opts = {
|
||||
copayerId: privateKey.getId(),
|
||||
//netKey: s.netKey,
|
||||
privkey: privateKey.getIdPriv()
|
||||
};
|
||||
self.network.cleanUp();
|
||||
|
|
|
|||
|
|
@ -44,7 +44,6 @@ Network.prototype.cleanUp = function() {
|
|||
this.started = false;
|
||||
this.connectedPeers = [];
|
||||
this.peerId = null;
|
||||
//this.netKey = null;
|
||||
this.privkey = null; //TODO: hide privkey in a closure
|
||||
this.copayerId = null;
|
||||
this.signingKey = null;
|
||||
|
|
@ -305,7 +304,6 @@ Network.prototype.start = function(opts, openCallback) {
|
|||
|
||||
if (this.started) return openCallback();
|
||||
|
||||
//this.netKey = opts.netKey;
|
||||
this.privkey = opts.privkey;
|
||||
this.maxPeers = opts.maxPeers || this.maxPeers;
|
||||
|
||||
|
|
@ -353,34 +351,12 @@ Network.prototype.getPeer = function() {
|
|||
Network.prototype._encrypt = function(pubkey, payload) {
|
||||
var encrypted = bitcore.ECIES.encrypt(pubkey, payload);
|
||||
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) {
|
||||
var decrypted = bitcore.ECIES.decrypt(privkey, encrypted);
|
||||
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) {
|
||||
|
|
@ -395,7 +371,6 @@ Network.prototype._sendToOne = function(copayerId, payload, sig, cb) {
|
|||
};
|
||||
|
||||
Network.prototype.send = function(copayerIds, payload, cb) {
|
||||
//if (!payload || !this.netKey) return cb();
|
||||
if (!payload) return cb();
|
||||
|
||||
var self=this;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue