diff --git a/build.gradle b/build.gradle index 7c8ab148..de1d1ee4 100644 --- a/build.gradle +++ b/build.gradle @@ -124,8 +124,8 @@ dependencies { exclude group: 'org.slf4j' } implementation('com.sparrowwallet.bokmakierie:bokmakierie:1.0') - implementation('io.samourai.code.whirlpool:whirlpool-client:1.0.1') - implementation('io.samourai.code.wallet:java-http-client:2.0.0') + implementation('io.samourai.code.whirlpool:whirlpool-client:1.0.5') + implementation('io.samourai.code.wallet:java-http-client:2.0.2') implementation('io.reactivex.rxjava2:rxjava:2.2.15') implementation('io.reactivex.rxjava2:rxjavafx:2.2.2') implementation('org.apache.commons:commons-lang3:3.7') diff --git a/src/main/java/com/sparrowwallet/sparrow/control/MixStatusCell.java b/src/main/java/com/sparrowwallet/sparrow/control/MixStatusCell.java index b646f80f..5beed7f6 100644 --- a/src/main/java/com/sparrowwallet/sparrow/control/MixStatusCell.java +++ b/src/main/java/com/sparrowwallet/sparrow/control/MixStatusCell.java @@ -70,7 +70,7 @@ public class MixStatusCell extends TreeTableCell { } private void setMixFail(MixFailReason mixFailReason, String mixError, Long mixErrorTimestamp) { - if(mixFailReason != MixFailReason.STOP_UTXO && !mixFailReason.isSilent()) { + if(mixFailReason.isError()) { long elapsed = mixErrorTimestamp == null ? 0L : System.currentTimeMillis() - mixErrorTimestamp; if(elapsed >= ERROR_DISPLAY_MILLIS) { //Old error, don't set again. diff --git a/src/main/java/com/sparrowwallet/sparrow/terminal/wallet/table/MixTableCell.java b/src/main/java/com/sparrowwallet/sparrow/terminal/wallet/table/MixTableCell.java index 49a822a1..49077588 100644 --- a/src/main/java/com/sparrowwallet/sparrow/terminal/wallet/table/MixTableCell.java +++ b/src/main/java/com/sparrowwallet/sparrow/terminal/wallet/table/MixTableCell.java @@ -43,7 +43,7 @@ public class MixTableCell extends TableCell { private String getMixFail(UtxoEntry.MixStatus mixStatus) { long elapsed = mixStatus.getMixErrorTimestamp() == null ? 0L : System.currentTimeMillis() - mixStatus.getMixErrorTimestamp(); - if(mixStatus.getMixFailReason() == MixFailReason.STOP_UTXO || mixStatus.getMixFailReason().isSilent() || elapsed >= ERROR_DISPLAY_MILLIS) { + if(mixStatus.getMixFailReason() == MixFailReason.STOP_UTXO || !mixStatus.getMixFailReason().isError() || elapsed >= ERROR_DISPLAY_MILLIS) { return getMixCountOnly(mixStatus); } diff --git a/src/main/java/com/sparrowwallet/sparrow/whirlpool/dataSource/SparrowDataSource.java b/src/main/java/com/sparrowwallet/sparrow/whirlpool/dataSource/SparrowDataSource.java index 3de4b86f..a9dede63 100644 --- a/src/main/java/com/sparrowwallet/sparrow/whirlpool/dataSource/SparrowDataSource.java +++ b/src/main/java/com/sparrowwallet/sparrow/whirlpool/dataSource/SparrowDataSource.java @@ -52,7 +52,8 @@ public class SparrowDataSource extends AbstractDataSource { super(whirlpoolWallet, bip44w, walletStateSupplier, dataSourceConfig); this.seenBackend = computeSeenBackend(whirlpoolWallet.getConfig()); this.pushTx = computePushTx(); - this.utxoSupplier = new SparrowUtxoSupplier(walletSupplier, utxoConfigSupplier, dataSourceConfig); + NetworkParameters params = whirlpoolWallet.getConfig().getSamouraiNetwork().getParams(); + this.utxoSupplier = new SparrowUtxoSupplier(walletSupplier, utxoConfigSupplier, dataSourceConfig, params); } private ISeenBackend computeSeenBackend(WhirlpoolWalletConfig whirlpoolWalletConfig) { diff --git a/src/main/java/com/sparrowwallet/sparrow/whirlpool/dataSource/SparrowUtxoSupplier.java b/src/main/java/com/sparrowwallet/sparrow/whirlpool/dataSource/SparrowUtxoSupplier.java index eb2c1a11..c0799fdf 100644 --- a/src/main/java/com/sparrowwallet/sparrow/whirlpool/dataSource/SparrowUtxoSupplier.java +++ b/src/main/java/com/sparrowwallet/sparrow/whirlpool/dataSource/SparrowUtxoSupplier.java @@ -16,6 +16,7 @@ import com.sparrowwallet.drongo.protocol.TransactionInput; import com.sparrowwallet.drongo.protocol.TransactionOutput; import com.sparrowwallet.drongo.wallet.*; import com.sparrowwallet.sparrow.whirlpool.Whirlpool; +import org.bitcoinj.core.NetworkParameters; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -28,8 +29,9 @@ public class SparrowUtxoSupplier extends BasicUtxoSupplier { public SparrowUtxoSupplier( WalletSupplier walletSupplier, UtxoConfigSupplier utxoConfigSupplier, - DataSourceConfig dataSourceConfig) { - super(walletSupplier, utxoConfigSupplier, dataSourceConfig); + DataSourceConfig dataSourceConfig, + NetworkParameters params) { + super(walletSupplier, utxoConfigSupplier, dataSourceConfig, params); } @Override @@ -120,13 +122,12 @@ public class SparrowUtxoSupplier extends BasicUtxoSupplier { // update utxos UnspentOutput[] uos = unspentOutputs.toArray(new UnspentOutput[0]); WalletResponse.Tx[] txs = txes.toArray(new WalletResponse.Tx[0]); - UtxoData utxoData = new UtxoData(uos, txs); + UtxoData utxoData = new UtxoData(uos, txs, storedBlockHeight); setValue(utxoData); } @Override - protected byte[] _getPrivKey(WhirlpoolUtxo whirlpoolUtxo) throws Exception { - UnspentOutput utxo = whirlpoolUtxo.getUtxo(); + public byte[] _getPrivKeyBip47(UnspentOutput utxo) throws Exception { Wallet wallet = SparrowDataSource.getWallet(utxo.xpub.m); Map walletUtxos = wallet.getWalletUtxos(); WalletNode node = walletUtxos.entrySet().stream()