strip as many trailing 00s as are present

This commit is contained in:
sneurlax 2024-01-12 14:16:42 -06:00
parent 660d98e5e4
commit 061be596f5

View file

@ -408,13 +408,13 @@ class ParticlWallet extends Bip39HDWallet
level: LogLevel.Error); level: LogLevel.Error);
throw Exception("Invalid hex string length."); throw Exception("Invalid hex string length.");
} }
int maxStrips = 3; // Strip up to 3 0x00s (match previous particl_wallet). // int maxStrips = 3; // Strip up to 3 0x00s (match previous particl_wallet).
while (hexString.endsWith('00') && hexString.length > 2) { while (hexString.endsWith('00') && hexString.length > 2) {
hexString = hexString.substring(0, hexString.length - 2); hexString = hexString.substring(0, hexString.length - 2);
maxStrips--; // maxStrips--;
if (maxStrips <= 0) { // if (maxStrips <= 0) {
break; // break;
} // }
} }
return txData.copyWith( return txData.copyWith(