Merge pull request #1349 from zeroleak/whirlpool-1.0.5

whirlpool 1.0.5
This commit is contained in:
craigraw 2024-04-02 11:05:38 +02:00 committed by GitHub
commit a9fd7c263f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 12 additions and 10 deletions

View file

@ -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')

View file

@ -70,7 +70,7 @@ public class MixStatusCell extends TreeTableCell<Entry, UtxoEntry.MixStatus> {
}
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.

View file

@ -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);
}

View file

@ -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) {

View file

@ -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<BlockTransactionHashIndex, WalletNode> walletUtxos = wallet.getWalletUtxos();
WalletNode node = walletUtxos.entrySet().stream()