mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-02-02 03:06:29 +00:00
simplify particl 00-stripping logic
This commit is contained in:
parent
3753a699ab
commit
660d98e5e4
1 changed files with 2 additions and 3 deletions
|
@ -408,12 +408,11 @@ class ParticlWallet extends Bip39HDWallet
|
|||
level: LogLevel.Error);
|
||||
throw Exception("Invalid hex string length.");
|
||||
}
|
||||
int numStrips = 0;
|
||||
int maxStrips = 3; // Strip up to 3 0x00s (match previous particl_wallet).
|
||||
while (hexString.endsWith('00') && hexString.length > 2) {
|
||||
hexString = hexString.substring(0, hexString.length - 2);
|
||||
numStrips++;
|
||||
if (numStrips >= maxStrips) {
|
||||
maxStrips--;
|
||||
if (maxStrips <= 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue