mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-23 19:05:51 +00:00
use bch44 derivation if bip44 is null
This commit is contained in:
parent
a6dae8d9e0
commit
80611d1a31
1 changed files with 14 additions and 4 deletions
|
@ -2736,19 +2736,28 @@ class BitcoinCashWallet extends CoinServiceAPI with WalletCache, WalletDB {
|
||||||
// p2pkh / bip44
|
// p2pkh / bip44
|
||||||
final p2pkhLength = addressesP2PKH.length;
|
final p2pkhLength = addressesP2PKH.length;
|
||||||
if (p2pkhLength > 0) {
|
if (p2pkhLength > 0) {
|
||||||
final receiveDerivations = await _fetchDerivations(
|
final receiveDerivationsBip44 = await _fetchDerivations(
|
||||||
chain: 0,
|
chain: 0,
|
||||||
derivePathType: DerivePathType.bip44,
|
derivePathType: DerivePathType.bip44,
|
||||||
);
|
);
|
||||||
final changeDerivations = await _fetchDerivations(
|
final changeDerivationsBip44 = await _fetchDerivations(
|
||||||
chain: 1,
|
chain: 1,
|
||||||
derivePathType: DerivePathType.bip44,
|
derivePathType: DerivePathType.bip44,
|
||||||
);
|
);
|
||||||
|
final receiveDerivationsBch44 = await _fetchDerivations(
|
||||||
|
chain: 0,
|
||||||
|
derivePathType: DerivePathType.bch44,
|
||||||
|
);
|
||||||
|
final changeDerivationsBch44 = await _fetchDerivations(
|
||||||
|
chain: 1,
|
||||||
|
derivePathType: DerivePathType.bch44,
|
||||||
|
);
|
||||||
for (int i = 0; i < p2pkhLength; i++) {
|
for (int i = 0; i < p2pkhLength; i++) {
|
||||||
String address = addressesP2PKH[i];
|
String address = addressesP2PKH[i];
|
||||||
|
|
||||||
// receives
|
// receives
|
||||||
final receiveDerivation = receiveDerivations[address];
|
final receiveDerivation = receiveDerivationsBip44[address] ??
|
||||||
|
receiveDerivationsBch44[address];
|
||||||
// if a match exists it will not be null
|
// if a match exists it will not be null
|
||||||
if (receiveDerivation != null) {
|
if (receiveDerivation != null) {
|
||||||
final data = P2PKH(
|
final data = P2PKH(
|
||||||
|
@ -2769,7 +2778,8 @@ class BitcoinCashWallet extends CoinServiceAPI with WalletCache, WalletDB {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// if its not a receive, check change
|
// if its not a receive, check change
|
||||||
final changeDerivation = changeDerivations[address];
|
final changeDerivation = changeDerivationsBip44[address] ??
|
||||||
|
changeDerivationsBch44[address];
|
||||||
// if a match exists it will not be null
|
// if a match exists it will not be null
|
||||||
if (changeDerivation != null) {
|
if (changeDerivation != null) {
|
||||||
final data = P2PKH(
|
final data = P2PKH(
|
||||||
|
|
Loading…
Reference in a new issue