mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-12-23 20:36:44 +00:00
import gap limit from electrum wallets
This commit is contained in:
parent
d7ce58d810
commit
3555a0bd85
1 changed files with 9 additions and 0 deletions
|
@ -95,6 +95,10 @@ public class Electrum implements KeystoreFileImport, WalletImport, WalletExport
|
|||
}
|
||||
}
|
||||
|
||||
if(key.equals("gap_limit") && map.get(key) instanceof JsonPrimitive gapLimit) {
|
||||
ew.gap_limit = gapLimit.getAsInt();
|
||||
}
|
||||
|
||||
if(key.equals("addresses")) {
|
||||
ew.addresses = gson.fromJson(map.get(key), ElectrumAddresses.class);
|
||||
}
|
||||
|
@ -209,6 +213,10 @@ public class Electrum implements KeystoreFileImport, WalletImport, WalletExport
|
|||
throw new ImportException("Unknown Electrum wallet type of " + ew.wallet_type);
|
||||
}
|
||||
|
||||
if(ew.gap_limit != null) {
|
||||
wallet.setGapLimit(ew.gap_limit);
|
||||
}
|
||||
|
||||
for(String key : ew.labels.keySet()) {
|
||||
try {
|
||||
Sha256Hash txHash = Sha256Hash.wrap(key);
|
||||
|
@ -408,6 +416,7 @@ public class Electrum implements KeystoreFileImport, WalletImport, WalletExport
|
|||
public String seed_type;
|
||||
public Boolean use_encryption;
|
||||
public ElectrumAddresses addresses;
|
||||
public Integer gap_limit;
|
||||
public Map<String, String> labels = new LinkedHashMap<>();
|
||||
public Map<Sha256Hash, BlockTransaction> transactions = new HashMap<>();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue