mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-11 05:04:35 +00:00
bch derivePath bug fix
This commit is contained in:
parent
9b4dee76a5
commit
eb42493e4d
1 changed files with 14 additions and 4 deletions
|
@ -59,14 +59,24 @@ String constructDerivePath({
|
||||||
required int chain,
|
required int chain,
|
||||||
required int index,
|
required int index,
|
||||||
}) {
|
}) {
|
||||||
String coinType;
|
int coinType;
|
||||||
switch (networkWIF) {
|
switch (networkWIF) {
|
||||||
case 0x80: // bch mainnet wif
|
case 0x80: // bch mainnet wif
|
||||||
coinType =
|
switch (derivePathType) {
|
||||||
derivePathType == DerivePathType.bch44 ? "145" : "0"; // bch mainnet
|
case DerivePathType.bip44:
|
||||||
|
case DerivePathType.bip49:
|
||||||
|
coinType = 145; // bch mainnet
|
||||||
|
break;
|
||||||
|
case DerivePathType.bch44: // bitcoin.com wallet specific
|
||||||
|
coinType = 0; // bch mainnet
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw Exception(
|
||||||
|
"DerivePathType $derivePathType not supported for coinType");
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 0xef: // bch testnet wif
|
case 0xef: // bch testnet wif
|
||||||
coinType = "1"; // bch testnet
|
coinType = 1; // bch testnet
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw Exception("Invalid Bitcoincash network wif used!");
|
throw Exception("Invalid Bitcoincash network wif used!");
|
||||||
|
|
Loading…
Reference in a new issue