mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-12-25 13:16:44 +00:00
upgrade to whirlpool 1.0.0-beta13
- HttpException now differenciates HttpResponseException & HttpNetworkException - MixFailReason.CANCEL becomes MixFailReason.STOP_UTXO. Also introduced NETWORK_ERROR, STOP_MIXING, ROTATE, and utilities such as .isError(), .isRequeue(), .isSilent()
This commit is contained in:
parent
da74089969
commit
2647f5085f
6 changed files with 10 additions and 7 deletions
|
@ -124,8 +124,8 @@ dependencies {
|
||||||
exclude group: 'org.slf4j'
|
exclude group: 'org.slf4j'
|
||||||
}
|
}
|
||||||
implementation('com.sparrowwallet.bokmakierie:bokmakierie:1.0')
|
implementation('com.sparrowwallet.bokmakierie:bokmakierie:1.0')
|
||||||
implementation('io.samourai.code.whirlpool:whirlpool-client:1.0.0-beta10')
|
implementation('io.samourai.code.whirlpool:whirlpool-client:1.0.0-beta13')
|
||||||
implementation('io.samourai.code.wallet:java-http-client:2.0.0-beta3')
|
implementation('io.samourai.code.wallet:java-http-client:2.0.0-beta4')
|
||||||
implementation('io.reactivex.rxjava2:rxjava:2.2.15')
|
implementation('io.reactivex.rxjava2:rxjava:2.2.15')
|
||||||
implementation('io.reactivex.rxjava2:rxjavafx:2.2.2')
|
implementation('io.reactivex.rxjava2:rxjavafx:2.2.2')
|
||||||
implementation('org.apache.commons:commons-lang3:3.7')
|
implementation('org.apache.commons:commons-lang3:3.7')
|
||||||
|
|
|
@ -70,7 +70,7 @@ public class MixStatusCell extends TreeTableCell<Entry, UtxoEntry.MixStatus> {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setMixFail(MixFailReason mixFailReason, String mixError, Long mixErrorTimestamp) {
|
private void setMixFail(MixFailReason mixFailReason, String mixError, Long mixErrorTimestamp) {
|
||||||
if(mixFailReason != MixFailReason.CANCEL) {
|
if(mixFailReason != MixFailReason.STOP_UTXO) {
|
||||||
long elapsed = mixErrorTimestamp == null ? 0L : System.currentTimeMillis() - mixErrorTimestamp;
|
long elapsed = mixErrorTimestamp == null ? 0L : System.currentTimeMillis() - mixErrorTimestamp;
|
||||||
if(elapsed >= ERROR_DISPLAY_MILLIS) {
|
if(elapsed >= ERROR_DISPLAY_MILLIS) {
|
||||||
//Old error, don't set again.
|
//Old error, don't set again.
|
||||||
|
|
|
@ -2,6 +2,7 @@ package com.sparrowwallet.sparrow.net;
|
||||||
|
|
||||||
import com.google.common.net.HostAndPort;
|
import com.google.common.net.HostAndPort;
|
||||||
import com.samourai.wallet.api.backend.beans.HttpException;
|
import com.samourai.wallet.api.backend.beans.HttpException;
|
||||||
|
import com.samourai.wallet.httpClient.HttpResponseException;
|
||||||
import com.sparrowwallet.drongo.Network;
|
import com.sparrowwallet.drongo.Network;
|
||||||
import com.sparrowwallet.drongo.Utils;
|
import com.sparrowwallet.drongo.Utils;
|
||||||
import com.sparrowwallet.drongo.protocol.Sha256Hash;
|
import com.sparrowwallet.drongo.protocol.Sha256Hash;
|
||||||
|
@ -158,7 +159,7 @@ public enum BroadcastSource {
|
||||||
} catch(Exception e) {
|
} catch(Exception e) {
|
||||||
throw new BroadcastException("Could not retrieve txid from broadcast, server returned: " + response);
|
throw new BroadcastException("Could not retrieve txid from broadcast, server returned: " + response);
|
||||||
}
|
}
|
||||||
} catch(HttpException e) {
|
} catch(HttpResponseException e) {
|
||||||
throw new BroadcastException("Could not broadcast transaction, server returned " + e.getStatusCode() + ": " + e.getResponseBody());
|
throw new BroadcastException("Could not broadcast transaction, server returned " + e.getStatusCode() + ": " + e.getResponseBody());
|
||||||
} catch(Exception e) {
|
} catch(Exception e) {
|
||||||
log.error("Could not post transaction via " + getName(), e);
|
log.error("Could not post transaction via " + getName(), e);
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package com.sparrowwallet.sparrow.net;
|
package com.sparrowwallet.sparrow.net;
|
||||||
|
|
||||||
import com.samourai.wallet.api.backend.beans.HttpException;
|
import com.samourai.wallet.api.backend.beans.HttpException;
|
||||||
|
import com.samourai.wallet.httpClient.HttpResponseException;
|
||||||
import com.sparrowwallet.sparrow.AppServices;
|
import com.sparrowwallet.sparrow.AppServices;
|
||||||
import com.sparrowwallet.sparrow.event.ExchangeRatesUpdatedEvent;
|
import com.sparrowwallet.sparrow.event.ExchangeRatesUpdatedEvent;
|
||||||
import javafx.concurrent.ScheduledService;
|
import javafx.concurrent.ScheduledService;
|
||||||
|
@ -107,7 +108,7 @@ public enum ExchangeSource {
|
||||||
if(log.isDebugEnabled()) {
|
if(log.isDebugEnabled()) {
|
||||||
log.warn("Error retrieving historical currency rates", e);
|
log.warn("Error retrieving historical currency rates", e);
|
||||||
} else {
|
} else {
|
||||||
if(e instanceof HttpException httpException && httpException.getStatusCode() == 404) {
|
if(e instanceof HttpResponseException httpException && httpException.getStatusCode() == 404) {
|
||||||
log.warn("Error retrieving historical currency rates (" + e.getMessage() + "). BTC-" + currency.getCurrencyCode() + " may not be supported by " + this);
|
log.warn("Error retrieving historical currency rates (" + e.getMessage() + "). BTC-" + currency.getCurrencyCode() + " may not be supported by " + this);
|
||||||
} else {
|
} else {
|
||||||
log.warn("Error retrieving historical currency rates (" + e.getMessage() + ")");
|
log.warn("Error retrieving historical currency rates (" + e.getMessage() + ")");
|
||||||
|
|
|
@ -3,6 +3,7 @@ package com.sparrowwallet.sparrow.payjoin;
|
||||||
import com.google.common.collect.ImmutableMap;
|
import com.google.common.collect.ImmutableMap;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.samourai.wallet.api.backend.beans.HttpException;
|
import com.samourai.wallet.api.backend.beans.HttpException;
|
||||||
|
import com.samourai.wallet.httpClient.HttpResponseException;
|
||||||
import com.sparrowwallet.drongo.protocol.Script;
|
import com.sparrowwallet.drongo.protocol.Script;
|
||||||
import com.sparrowwallet.drongo.protocol.Transaction;
|
import com.sparrowwallet.drongo.protocol.Transaction;
|
||||||
import com.sparrowwallet.drongo.protocol.TransactionInput;
|
import com.sparrowwallet.drongo.protocol.TransactionInput;
|
||||||
|
@ -87,7 +88,7 @@ public class Payjoin {
|
||||||
checkProposal(psbt, proposalPsbt, changeOutputIndex, maxAdditionalFeeContribution, allowOutputSubstitution);
|
checkProposal(psbt, proposalPsbt, changeOutputIndex, maxAdditionalFeeContribution, allowOutputSubstitution);
|
||||||
|
|
||||||
return proposalPsbt;
|
return proposalPsbt;
|
||||||
} catch(HttpException e) {
|
} catch(HttpResponseException e) {
|
||||||
Gson gson = new Gson();
|
Gson gson = new Gson();
|
||||||
PayjoinReceiverError payjoinReceiverError = gson.fromJson(e.getResponseBody(), PayjoinReceiverError.class);
|
PayjoinReceiverError payjoinReceiverError = gson.fromJson(e.getResponseBody(), PayjoinReceiverError.class);
|
||||||
log.warn("Payjoin receiver returned an error of " + payjoinReceiverError.getErrorCode() + " (" + payjoinReceiverError.getMessage() + ")");
|
log.warn("Payjoin receiver returned an error of " + payjoinReceiverError.getErrorCode() + " (" + payjoinReceiverError.getMessage() + ")");
|
||||||
|
|
|
@ -43,7 +43,7 @@ public class MixTableCell extends TableCell {
|
||||||
|
|
||||||
private String getMixFail(UtxoEntry.MixStatus mixStatus) {
|
private String getMixFail(UtxoEntry.MixStatus mixStatus) {
|
||||||
long elapsed = mixStatus.getMixErrorTimestamp() == null ? 0L : System.currentTimeMillis() - mixStatus.getMixErrorTimestamp();
|
long elapsed = mixStatus.getMixErrorTimestamp() == null ? 0L : System.currentTimeMillis() - mixStatus.getMixErrorTimestamp();
|
||||||
if(mixStatus.getMixFailReason() == MixFailReason.CANCEL || elapsed >= ERROR_DISPLAY_MILLIS) {
|
if(mixStatus.getMixFailReason() == MixFailReason.STOP_UTXO || elapsed >= ERROR_DISPLAY_MILLIS) {
|
||||||
return getMixCountOnly(mixStatus);
|
return getMixCountOnly(mixStatus);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue