commit
ace128dfe9
7 changed files with 39 additions and 37 deletions
|
|
@ -19,6 +19,9 @@ console.log('[signin.js.23:walletId:]',walletId); //TODO
|
|||
};
|
||||
|
||||
$scope.join = function(secret) {
|
||||
if (!secret || !secret.length) {
|
||||
return;
|
||||
}
|
||||
$scope.loading = true;
|
||||
|
||||
walletFactory.network.on('joinError', function() {
|
||||
|
|
|
|||
|
|
@ -23,7 +23,8 @@ PrivateKey.prototype.getId = function(prefix) {
|
|||
if (prefix) {
|
||||
buf = Buffer.concat([prefix, buf]);
|
||||
}
|
||||
return util.ripe160(buf).toString('hex');
|
||||
var hash = util.sha256(buf).toString('hex');
|
||||
return hash.substring(0, hash.length/2);
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -82,7 +82,8 @@ PublicKeyRing.prototype.getCopayerId = function(i, prefix) {
|
|||
if (prefix) {
|
||||
buf = Buffer.concat([prefix, buf]);
|
||||
}
|
||||
return util.ripe160(buf).toString('hex');
|
||||
var hash = util.sha256(buf).toString('hex');
|
||||
return hash.substring(0, hash.length/2);
|
||||
};
|
||||
|
||||
PublicKeyRing.prototype.myCopayerId = function(i, prefix) {
|
||||
|
|
|
|||
|
|
@ -144,17 +144,7 @@ Wallet.prototype._optsToObj = function () {
|
|||
|
||||
|
||||
Wallet.prototype.getPeerId = function(index) {
|
||||
// if (typeof index === 'undefined') {
|
||||
// // return my own peerId
|
||||
// var gen = this.privateKey.getId(idBuf);
|
||||
// return gen;
|
||||
// }
|
||||
// return peer number 'index' peerId
|
||||
//
|
||||
var idBuf;
|
||||
// TODO idBuf DISABLED FOR NOW
|
||||
//idBuf = new Buffer(this.id);
|
||||
return this.publicKeyRing.getCopayerId(index || 0, idBuf);
|
||||
return this.publicKeyRing.getCopayerId(index || 0);
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue