mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-02-23 07:15:35 +01:00
ADD: use passphrase to get wallet ID
This commit is contained in:
parent
bd91e7df59
commit
b02d7cd04b
2 changed files with 4 additions and 2 deletions
|
@ -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() {
|
||||
|
|
|
@ -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');
|
||||
},
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue