mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-12-24 12:46:45 +00:00
upgrade to nightjar 0.2.19 (whirlpool client 0.23.37), minor tx diagram improvements
This commit is contained in:
parent
f4810bb568
commit
9520f6d218
8 changed files with 24 additions and 15 deletions
|
@ -91,7 +91,7 @@ dependencies {
|
||||||
implementation('org.slf4j:jul-to-slf4j:1.7.30') {
|
implementation('org.slf4j:jul-to-slf4j:1.7.30') {
|
||||||
exclude group: 'org.slf4j'
|
exclude group: 'org.slf4j'
|
||||||
}
|
}
|
||||||
implementation('com.sparrowwallet.nightjar:nightjar:0.2.18-SNAPSHOT')
|
implementation('com.sparrowwallet.nightjar:nightjar:0.2.19')
|
||||||
testImplementation('junit:junit:4.12')
|
testImplementation('junit:junit:4.12')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -449,7 +449,7 @@ extraJavaModuleInfo {
|
||||||
module('cbor-0.9.jar', 'co.nstant.in.cbor', '0.9') {
|
module('cbor-0.9.jar', 'co.nstant.in.cbor', '0.9') {
|
||||||
exports('co.nstant.in.cbor')
|
exports('co.nstant.in.cbor')
|
||||||
}
|
}
|
||||||
module('nightjar-0.2.18-SNAPSHOT.jar', 'com.sparrowwallet.nightjar', '0.2.18-SNAPSHOT') {
|
module('nightjar-0.2.19.jar', 'com.sparrowwallet.nightjar', '0.2.19') {
|
||||||
requires('com.google.common')
|
requires('com.google.common')
|
||||||
requires('net.sourceforge.streamsupport')
|
requires('net.sourceforge.streamsupport')
|
||||||
requires('org.slf4j')
|
requires('org.slf4j')
|
||||||
|
|
2
drongo
2
drongo
|
@ -1 +1 @@
|
||||||
Subproject commit 99440eda7f8a2b5a8adec68d32a704634157a3d3
|
Subproject commit 24d9e5fcda84058c48964e2abe21600f61ec359d
|
|
@ -48,7 +48,7 @@ public class AddressCell extends TreeTableCell<Entry, UtxoEntry.AddressStatus> {
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getTooltipText(UtxoEntry utxoEntry, boolean duplicate) {
|
private String getTooltipText(UtxoEntry utxoEntry, boolean duplicate) {
|
||||||
return utxoEntry.getNode().getDerivationPath().replace("m", "..") + (duplicate ? " (Duplicate address)" : "");
|
return utxoEntry.getNode().toString() + (duplicate ? " (Duplicate address)" : "");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Glyph getDuplicateGlyph() {
|
public static Glyph getDuplicateGlyph() {
|
||||||
|
|
|
@ -106,7 +106,7 @@ public class EntryCell extends TreeTableCell<Entry, Entry> {
|
||||||
setText(address.toString());
|
setText(address.toString());
|
||||||
setContextMenu(new AddressContextMenu(address, nodeEntry.getOutputDescriptor(), nodeEntry));
|
setContextMenu(new AddressContextMenu(address, nodeEntry.getOutputDescriptor(), nodeEntry));
|
||||||
Tooltip tooltip = new Tooltip();
|
Tooltip tooltip = new Tooltip();
|
||||||
tooltip.setText(nodeEntry.getNode().getDerivationPath().replace("m", ".."));
|
tooltip.setText(nodeEntry.getNode().toString());
|
||||||
setTooltip(tooltip);
|
setTooltip(tooltip);
|
||||||
getStyleClass().add("address-cell");
|
getStyleClass().add("address-cell");
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,8 @@ import org.controlsfx.glyphfont.Glyph;
|
||||||
import org.controlsfx.tools.Platform;
|
import org.controlsfx.tools.Platform;
|
||||||
|
|
||||||
public class MixStatusCell extends TreeTableCell<Entry, UtxoEntry.MixStatus> {
|
public class MixStatusCell extends TreeTableCell<Entry, UtxoEntry.MixStatus> {
|
||||||
|
private static final int ERROR_DISPLAY_MINUTES = 5;
|
||||||
|
|
||||||
public MixStatusCell() {
|
public MixStatusCell() {
|
||||||
super();
|
super();
|
||||||
setAlignment(Pos.CENTER_RIGHT);
|
setAlignment(Pos.CENTER_RIGHT);
|
||||||
|
@ -46,7 +48,7 @@ public class MixStatusCell extends TreeTableCell<Entry, UtxoEntry.MixStatus> {
|
||||||
if(mixStatus.getNextMixUtxo() != null) {
|
if(mixStatus.getNextMixUtxo() != null) {
|
||||||
setMixSuccess(mixStatus.getNextMixUtxo());
|
setMixSuccess(mixStatus.getNextMixUtxo());
|
||||||
} else if(mixStatus.getMixFailReason() != null) {
|
} else if(mixStatus.getMixFailReason() != null) {
|
||||||
setMixFail(mixStatus.getMixFailReason(), mixStatus.getMixError());
|
setMixFail(mixStatus.getMixFailReason(), mixStatus.getMixError(), mixStatus.getMixErrorTimestamp());
|
||||||
} else if(mixStatus.getMixProgress() != null) {
|
} else if(mixStatus.getMixProgress() != null) {
|
||||||
setMixProgress(mixStatus.getUtxoEntry(), mixStatus.getMixProgress());
|
setMixProgress(mixStatus.getUtxoEntry(), mixStatus.getMixProgress());
|
||||||
} else {
|
} else {
|
||||||
|
@ -65,10 +67,10 @@ public class MixStatusCell extends TreeTableCell<Entry, UtxoEntry.MixStatus> {
|
||||||
setTooltip(tt);
|
setTooltip(tt);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setMixFail(MixFailReason mixFailReason, String mixError) {
|
private void setMixFail(MixFailReason mixFailReason, String mixError, Long mixErrorTimestamp) {
|
||||||
if(mixFailReason != MixFailReason.CANCEL) {
|
if(mixFailReason != MixFailReason.CANCEL) {
|
||||||
if(getGraphic() != null && getGraphic().getUserData() == mixFailReason) {
|
if(mixErrorTimestamp != null && System.currentTimeMillis() - mixErrorTimestamp > ERROR_DISPLAY_MINUTES * 60 * 1000) {
|
||||||
//Fade transition already set
|
//Old error, don't set again.
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -81,7 +83,7 @@ public class MixStatusCell extends TreeTableCell<Entry, UtxoEntry.MixStatus> {
|
||||||
"\nTo prevent sleeping, use the " + getPlatformSleepConfig() + " or enable the function in the Tools menu.");
|
"\nTo prevent sleeping, use the " + getPlatformSleepConfig() + " or enable the function in the Tools menu.");
|
||||||
setTooltip(tt);
|
setTooltip(tt);
|
||||||
|
|
||||||
FadeTransition ft = new FadeTransition(Duration.hours(1), failGlyph);
|
FadeTransition ft = new FadeTransition(Duration.minutes(ERROR_DISPLAY_MINUTES), failGlyph);
|
||||||
ft.setFromValue(1);
|
ft.setFromValue(1);
|
||||||
ft.setToValue(0);
|
ft.setToValue(0);
|
||||||
ft.setOnFinished(event -> {
|
ft.setOnFinished(event -> {
|
||||||
|
|
|
@ -222,7 +222,7 @@ public class TransactionDiagram extends GridPane {
|
||||||
|
|
||||||
Tooltip tooltip = new Tooltip();
|
Tooltip tooltip = new Tooltip();
|
||||||
if(walletNode != null) {
|
if(walletNode != null) {
|
||||||
tooltip.setText("Spending " + getSatsValue(input.getValue()) + " sats from " + walletNode.getDerivationPath().replace("m", "..") + "\n" + input.getHashAsString() + ":" + input.getIndex() + "\n" + walletTx.getWallet().getAddress(walletNode));
|
tooltip.setText("Spending " + getSatsValue(input.getValue()) + " sats from " + (isFinal() ? walletTx.getWallet().getFullName() : "") + " " + walletNode + "\n" + input.getHashAsString() + ":" + input.getIndex() + "\n" + walletTx.getWallet().getAddress(walletNode));
|
||||||
tooltip.getStyleClass().add("input-label");
|
tooltip.getStyleClass().add("input-label");
|
||||||
|
|
||||||
if(input.getLabel() == null || input.getLabel().isEmpty()) {
|
if(input.getLabel() == null || input.getLabel().isEmpty()) {
|
||||||
|
@ -397,9 +397,10 @@ public class TransactionDiagram extends GridPane {
|
||||||
recipientLabel.getStyleClass().add("output-label");
|
recipientLabel.getStyleClass().add("output-label");
|
||||||
recipientLabel.getStyleClass().add(labelledPayment ? "payment-label" : "recipient-label");
|
recipientLabel.getStyleClass().add(labelledPayment ? "payment-label" : "recipient-label");
|
||||||
Wallet toWallet = getToWallet(payment);
|
Wallet toWallet = getToWallet(payment);
|
||||||
Tooltip recipientTooltip = new Tooltip((toWallet == null ? (walletTx.isConsolidationSend(payment) ? "Consolidate " : "Pay ") : "Receive ")
|
WalletNode toNode = walletTx.getWallet() != null ? walletTx.getWallet().getWalletAddresses().get(payment.getAddress()) : null;
|
||||||
|
Tooltip recipientTooltip = new Tooltip((toWallet == null ? (toNode != null ? "Consolidate " : "Pay ") : "Receive ")
|
||||||
+ getSatsValue(payment.getAmount()) + " sats to "
|
+ getSatsValue(payment.getAmount()) + " sats to "
|
||||||
+ (payment instanceof AdditionalPayment ? "\n" + payment : (toWallet == null ? (payment.getLabel() == null ? "external address" : payment.getLabel()) : toWallet.getName()) + "\n" + payment.getAddress().toString()));
|
+ (payment instanceof AdditionalPayment ? "\n" + payment : (toWallet == null ? (payment.getLabel() == null ? (toNode != null ? toNode : "external address") : payment.getLabel()) : toWallet.getName()) + "\n" + payment.getAddress().toString()));
|
||||||
recipientTooltip.getStyleClass().add("recipient-label");
|
recipientTooltip.getStyleClass().add("recipient-label");
|
||||||
recipientTooltip.setShowDelay(new Duration(TOOLTIP_SHOW_DELAY));
|
recipientTooltip.setShowDelay(new Duration(TOOLTIP_SHOW_DELAY));
|
||||||
recipientLabel.setTooltip(recipientTooltip);
|
recipientLabel.setTooltip(recipientTooltip);
|
||||||
|
@ -416,7 +417,7 @@ public class TransactionDiagram extends GridPane {
|
||||||
String changeDesc = changeAddress.toString().substring(0, 8) + "...";
|
String changeDesc = changeAddress.toString().substring(0, 8) + "...";
|
||||||
Label changeLabel = new Label(changeDesc, overGapLimit ? getChangeWarningGlyph() : getChangeGlyph());
|
Label changeLabel = new Label(changeDesc, overGapLimit ? getChangeWarningGlyph() : getChangeGlyph());
|
||||||
changeLabel.getStyleClass().addAll("output-label", "change-label");
|
changeLabel.getStyleClass().addAll("output-label", "change-label");
|
||||||
Tooltip changeTooltip = new Tooltip("Change of " + getSatsValue(changeEntry.getValue()) + " sats to " + changeNode.getDerivationPath().replace("m", "..") + "\n" + walletTx.getChangeAddress(changeNode).toString() + (overGapLimit ? "\nAddress is beyond the gap limit!" : ""));
|
Tooltip changeTooltip = new Tooltip("Change of " + getSatsValue(changeEntry.getValue()) + " sats to " + changeNode + "\n" + walletTx.getChangeAddress(changeNode).toString() + (overGapLimit ? "\nAddress is beyond the gap limit!" : ""));
|
||||||
changeTooltip.getStyleClass().add("change-label");
|
changeTooltip.getStyleClass().add("change-label");
|
||||||
changeTooltip.setShowDelay(new Duration(TOOLTIP_SHOW_DELAY));
|
changeTooltip.setShowDelay(new Duration(TOOLTIP_SHOW_DELAY));
|
||||||
changeLabel.setTooltip(changeTooltip);
|
changeLabel.setTooltip(changeTooltip);
|
||||||
|
|
|
@ -128,6 +128,7 @@ public class UtxoEntry extends HashIndexEntry {
|
||||||
private Utxo nextMixUtxo;
|
private Utxo nextMixUtxo;
|
||||||
private MixFailReason mixFailReason;
|
private MixFailReason mixFailReason;
|
||||||
private String mixError;
|
private String mixError;
|
||||||
|
private Long mixErrorTimestamp;
|
||||||
|
|
||||||
public MixStatus(MixProgress mixProgress) {
|
public MixStatus(MixProgress mixProgress) {
|
||||||
this.mixProgress = mixProgress;
|
this.mixProgress = mixProgress;
|
||||||
|
@ -140,6 +141,7 @@ public class UtxoEntry extends HashIndexEntry {
|
||||||
public MixStatus(MixFailReason mixFailReason, String mixError) {
|
public MixStatus(MixFailReason mixFailReason, String mixError) {
|
||||||
this.mixFailReason = mixFailReason;
|
this.mixFailReason = mixFailReason;
|
||||||
this.mixError = mixError;
|
this.mixError = mixError;
|
||||||
|
this.mixErrorTimestamp = System.currentTimeMillis();
|
||||||
}
|
}
|
||||||
|
|
||||||
public UtxoEntry getUtxoEntry() {
|
public UtxoEntry getUtxoEntry() {
|
||||||
|
@ -182,5 +184,9 @@ public class UtxoEntry extends HashIndexEntry {
|
||||||
public String getMixError() {
|
public String getMixError() {
|
||||||
return mixError;
|
return mixError;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Long getMixErrorTimestamp() {
|
||||||
|
return mixErrorTimestamp;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -173,7 +173,7 @@ public class Whirlpool {
|
||||||
HD_WalletFactoryGeneric hdWalletFactory = HD_WalletFactoryGeneric.getInstance();
|
HD_WalletFactoryGeneric hdWalletFactory = HD_WalletFactoryGeneric.getInstance();
|
||||||
byte[] seed = hdWalletFactory.computeSeedFromWords(words);
|
byte[] seed = hdWalletFactory.computeSeedFromWords(words);
|
||||||
this.walletId = walletId;
|
this.walletId = walletId;
|
||||||
hdWallet = new HD_Wallet(purpose, words, config.getNetworkParameters(), seed, passphrase, 10);
|
hdWallet = new HD_Wallet(purpose, words, config.getNetworkParameters(), seed, passphrase);
|
||||||
} catch(Exception e) {
|
} catch(Exception e) {
|
||||||
throw new IllegalStateException("Could not create Whirlpool HD wallet ", e);
|
throw new IllegalStateException("Could not create Whirlpool HD wallet ", e);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue