mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2026-08-09 08:14:43 +00:00
fix various refresh history issues when updating node sets
This commit is contained in:
+1
-1
Submodule drongo updated: 0734757a17...04631be8c1
@@ -1303,6 +1303,11 @@ public class ElectrumServer {
|
||||
return false;
|
||||
}
|
||||
|
||||
Set<WalletNode> nodes = (filterToNodes == null ? null : filterToNodes.stream().filter(node -> node.getWallet().equals(wallet)).collect(Collectors.toSet()));
|
||||
if(filterToNodes != null && nodes.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean initial = (walletSynchronizeLocks.putIfAbsent(wallet, new Object()) == null);
|
||||
synchronized(walletSynchronizeLocks.get(wallet)) {
|
||||
if(initial) {
|
||||
@@ -1311,7 +1316,6 @@ public class ElectrumServer {
|
||||
|
||||
if(isConnected()) {
|
||||
ElectrumServer electrumServer = new ElectrumServer();
|
||||
Set<WalletNode> nodes = (filterToNodes == null ? null : filterToNodes.stream().filter(node -> node.getWallet().equals(wallet)).collect(Collectors.toSet()));
|
||||
|
||||
Map<String, String> previousScriptHashes = getCalculatedScriptHashes(wallet);
|
||||
Map<WalletNode, Set<BlockTransactionHash>> nodeTransactionMap = (nodes == null ? electrumServer.getHistory(wallet) : electrumServer.getHistory(wallet, nodes));
|
||||
|
||||
@@ -259,12 +259,12 @@ public class WalletForm {
|
||||
}
|
||||
|
||||
private List<WalletNode> getHistoryChangedNodes(Set<WalletNode> previousNodes, Set<WalletNode> currentNodes) {
|
||||
Map<WalletNode, WalletNode> previousNodeMap = new HashMap<>(previousNodes.size());
|
||||
previousNodes.forEach(walletNode -> previousNodeMap.put(walletNode, walletNode));
|
||||
Map<String, WalletNode> previousNodeMap = new HashMap<>(previousNodes.size());
|
||||
previousNodes.forEach(walletNode -> previousNodeMap.put(walletNode.getDerivationPath(), walletNode));
|
||||
|
||||
List<WalletNode> changedNodes = new ArrayList<>();
|
||||
for(WalletNode currentNode : currentNodes) {
|
||||
WalletNode previousNode = previousNodeMap.get(currentNode);
|
||||
WalletNode previousNode = previousNodeMap.get(currentNode.getDerivationPath());
|
||||
if(previousNode != null) {
|
||||
if(!currentNode.getTransactionOutputs().equals(previousNode.getTransactionOutputs())) {
|
||||
changedNodes.add(currentNode);
|
||||
@@ -286,7 +286,7 @@ public class WalletForm {
|
||||
return null;
|
||||
}
|
||||
|
||||
Set<WalletNode> allNodes = new LinkedHashSet<>();
|
||||
Set<WalletNode> allNodes = new LinkedHashSet<>(walletNodes);
|
||||
for(WalletNode walletNode : walletNodes) {
|
||||
for(Set<WalletNode> nodes : walletTransactionNodes) {
|
||||
if(nodes.contains(walletNode)) {
|
||||
|
||||
Reference in New Issue
Block a user