mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2026-08-09 08:14:43 +00:00
add all whirlpool accounts if any one is discovered on wallet import
This commit is contained in:
+1
-1
Submodule drongo updated: 1a20e0381c...d05ec39df7
@@ -1014,7 +1014,9 @@ public class AppController implements Initializable {
|
||||
for(Map.Entry<WalletAndKey, Storage> entry : walletAndKey.getChildWallets().entrySet()) {
|
||||
openWallet(entry.getValue(), entry.getKey(), walletAppController, true);
|
||||
}
|
||||
Platform.runLater(() -> selectTab(walletAndKey.getWallet()));
|
||||
if(walletAndKey.getWallet().isMasterWallet()) {
|
||||
Platform.runLater(() -> selectTab(walletAndKey.getWallet()));
|
||||
}
|
||||
} catch(Exception e) {
|
||||
log.error("Error opening wallet", e);
|
||||
showErrorDialog("Error Opening Wallet", e.getMessage());
|
||||
|
||||
@@ -1587,17 +1587,26 @@ public class ElectrumServer {
|
||||
if(nodeTransactionMap.values().stream().anyMatch(blockTransactionHashes -> !blockTransactionHashes.isEmpty())) {
|
||||
Wallet masterWalletCopy = wallet.copy();
|
||||
List<StandardAccount> searchAccounts = getStandardAccounts(wallet);
|
||||
Set<StandardAccount> foundAccounts = new LinkedHashSet<>();
|
||||
for(int j = 0; j < searchAccounts.size(); j++) {
|
||||
StandardAccount standardAccount = searchAccounts.get(j);
|
||||
Wallet childWallet = masterWalletCopy.addChildWallet(standardAccount);
|
||||
Map<WalletNode, Set<BlockTransactionHash>> childTransactionMap = new TreeMap<>();
|
||||
electrumServer.getReferences(childWallet, childWallet.getNode(KeyPurpose.RECEIVE).getChildren(), childTransactionMap, 0);
|
||||
if(childTransactionMap.values().stream().anyMatch(blockTransactionHashes -> !blockTransactionHashes.isEmpty())) {
|
||||
wallet.addChildWallet(standardAccount);
|
||||
if(StandardAccount.WHIRLPOOL_ACCOUNTS.contains(standardAccount)) {
|
||||
foundAccounts.addAll(StandardAccount.WHIRLPOOL_ACCOUNTS);
|
||||
} else {
|
||||
foundAccounts.add(standardAccount);
|
||||
}
|
||||
}
|
||||
updateProgress(i + j, wallets.size() + StandardAccount.values().length);
|
||||
}
|
||||
|
||||
for(StandardAccount standardAccount : foundAccounts) {
|
||||
wallet.addChildWallet(standardAccount);
|
||||
}
|
||||
|
||||
return Optional.of(wallet);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user