mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-03-12 09:27:01 +00:00
Fix trailing bytes issue
This commit is contained in:
parent
d4f494bbaa
commit
b890fe61db
1 changed files with 16 additions and 3 deletions
|
@ -3134,9 +3134,22 @@ class ParticlWallet extends CoinServiceAPI {
|
||||||
|
|
||||||
String hexBefore = builtTx.toHex().toString();
|
String hexBefore = builtTx.toHex().toString();
|
||||||
|
|
||||||
String strippedTrailingBytes =
|
// String strippedTrailingBytes =
|
||||||
hexBefore.replaceAll(RegExp(r"([.]*0+)(?!.*\d)"), "");
|
// hexBefore.replaceAll(RegExp(r"([.]*0+)(?!.*\d)"), "");
|
||||||
return {"hex": strippedTrailingBytes, "vSize": vSize};
|
// return {"hex": strippedTrailingBytes, "vSize": vSize};
|
||||||
|
|
||||||
|
if (hexBefore.endsWith('000000')) {
|
||||||
|
String stripped = hexBefore.substring(0, hexBefore.length - 6);
|
||||||
|
return {"hex": stripped, "vSize": vSize};
|
||||||
|
} else if (hexBefore.endsWith('0000')) {
|
||||||
|
String stripped = hexBefore.substring(0, hexBefore.length - 4);
|
||||||
|
return {"hex": stripped, "vSize": vSize};
|
||||||
|
} else if (hexBefore.endsWith('00')) {
|
||||||
|
String stripped = hexBefore.substring(0, hexBefore.length - 2);
|
||||||
|
return {"hex": stripped, "vSize": vSize};
|
||||||
|
} else {
|
||||||
|
return {"hex": hexBefore, "vSize": vSize};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
Loading…
Reference in a new issue