ADD: use passphrase to get wallet ID

This commit is contained in:
Ivan Vershigora 2021-05-14 19:21:35 +03:00
parent bd91e7df59
commit b02d7cd04b
2 changed files with 4 additions and 2 deletions

View file

@ -45,7 +45,9 @@ export class AbstractWallet {
}
getID() {
return createHash('sha256').update(this.getSecret()).digest().toString('hex');
const passphrase = this.getPassphrase ? this.getPassphrase() : '';
const string2hash = this.getSecret() + passphrase;
return createHash('sha256').update(string2hash).digest().toString('hex');
}
getTransactions() {

View file

@ -39,7 +39,7 @@ const SLIP39Mixin = {
},
getID() {
const string2hash = this.secret.sort().join(',');
const string2hash = this.secret.sort().join(',') + (this.getPassphrase() || '');
return createHash('sha256').update(string2hash).digest().toString('hex');
},
};