mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-01-10 21:04:53 +00:00
deterministic fix
This commit is contained in:
parent
6202363c5c
commit
28a615a0a7
1 changed files with 9 additions and 3 deletions
|
@ -150,18 +150,24 @@ class BitcoinWalletService extends WalletService<BitcoinNewWalletCredentials,
|
||||||
|
|
||||||
for (DerivationInfo dInfo in bitcoin_derivations[dType]!) {
|
for (DerivationInfo dInfo in bitcoin_derivations[dType]!) {
|
||||||
try {
|
try {
|
||||||
|
DerivationInfo dInfoCopy = DerivationInfo(
|
||||||
|
derivationType: dInfo.derivationType,
|
||||||
|
derivationPath: dInfo.derivationPath,
|
||||||
|
description: dInfo.description,
|
||||||
|
script_type: dInfo.script_type,
|
||||||
|
);
|
||||||
var node = bip32.BIP32.fromSeed(seedBytes);
|
var node = bip32.BIP32.fromSeed(seedBytes);
|
||||||
|
|
||||||
String derivationPath = dInfo.derivationPath!;
|
String derivationPath = dInfoCopy.derivationPath!;
|
||||||
int derivationDepth = countOccurrences(derivationPath, "/");
|
int derivationDepth = countOccurrences(derivationPath, "/");
|
||||||
if (derivationDepth == 3) {
|
if (derivationDepth == 3) {
|
||||||
derivationPath += "/0/0";
|
derivationPath += "/0/0";
|
||||||
dInfo.derivationPath = dInfo.derivationPath! + "/0";
|
dInfoCopy.derivationPath = dInfoCopy.derivationPath! + "/0";
|
||||||
}
|
}
|
||||||
node = node.derivePath(derivationPath);
|
node = node.derivePath(derivationPath);
|
||||||
|
|
||||||
String? address;
|
String? address;
|
||||||
switch (dInfo.script_type) {
|
switch (dInfoCopy.script_type) {
|
||||||
case "p2wpkh":
|
case "p2wpkh":
|
||||||
address = bitcoin
|
address = bitcoin
|
||||||
.P2WPKH(
|
.P2WPKH(
|
||||||
|
|
Loading…
Reference in a new issue