mirror of
https://github.com/sparrowwallet/drongo.git
synced 2024-12-25 17:46:44 +00:00
retain utxo frozen status on wallet refresh
This commit is contained in:
parent
a8df17ff5e
commit
d5abf351be
2 changed files with 9 additions and 0 deletions
|
@ -1660,6 +1660,10 @@ public class Wallet extends Persistable implements Comparable<Wallet> {
|
||||||
labels.put(output.getHash().toString() + "<" + output.getIndex(), output.getLabel());
|
labels.put(output.getHash().toString() + "<" + output.getIndex(), output.getLabel());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(output.getStatus() != null) {
|
||||||
|
labels.put(output.getHash().toString() + ":" + output.getIndex(), output.getStatus().toString());
|
||||||
|
}
|
||||||
|
|
||||||
if(output.isSpent() && output.getSpentBy().getLabel() != null && !output.getSpentBy().getLabel().isEmpty()) {
|
if(output.isSpent() && output.getSpentBy().getLabel() != null && !output.getSpentBy().getLabel().isEmpty()) {
|
||||||
labels.put(output.getSpentBy().getHash() + ">" + output.getSpentBy().getIndex(), output.getSpentBy().getLabel());
|
labels.put(output.getSpentBy().getHash() + ">" + output.getSpentBy().getIndex(), output.getSpentBy().getLabel());
|
||||||
}
|
}
|
||||||
|
|
|
@ -149,6 +149,11 @@ public class WalletNode extends Persistable implements Comparable<WalletNode> {
|
||||||
txo.setLabel(label);
|
txo.setLabel(label);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String status = wallet.getDetachedLabels().remove(txo.getHash().toString() + ":" + txo.getIndex());
|
||||||
|
if(status != null && txo.getStatus() == null) {
|
||||||
|
txo.setStatus(Status.valueOf(status));
|
||||||
|
}
|
||||||
|
|
||||||
if(txo.isSpent()) {
|
if(txo.isSpent()) {
|
||||||
String spentByLabel = wallet.getDetachedLabels().remove(txo.getSpentBy().getHash() + ">" + txo.getSpentBy().getIndex());
|
String spentByLabel = wallet.getDetachedLabels().remove(txo.getSpentBy().getHash() + ">" + txo.getSpentBy().getIndex());
|
||||||
if(spentByLabel != null && (txo.getSpentBy().getLabel() == null || txo.getSpentBy().getLabel().isEmpty())) {
|
if(spentByLabel != null && (txo.getSpentBy().getLabel() == null || txo.getSpentBy().getLabel().isEmpty())) {
|
||||||
|
|
Loading…
Reference in a new issue