mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-11-02 20:36:44 +00:00
upgrade to whirlpool-client 0.23.33
This commit is contained in:
parent
dbebade3ab
commit
6939d8a06a
3 changed files with 5 additions and 18 deletions
|
@ -158,9 +158,8 @@ public class SparrowDataSource extends WalletResponseDataSource {
|
|||
walletResponse.info.latest_block.time = AppServices.getLatestBlockHeader() == null ? 1 : AppServices.getLatestBlockHeader().getTime();
|
||||
|
||||
walletResponse.info.fees = new LinkedHashMap<>();
|
||||
MinerFee minerFee = getMinerFeeSupplier().getValue();
|
||||
for(MinerFeeTarget target : MinerFeeTarget.values()) {
|
||||
walletResponse.info.fees.put(target.getValue(), minerFee.get(target));
|
||||
walletResponse.info.fees.put(target.getValue(), getMinerFeeSupplier().getFee(target));
|
||||
}
|
||||
|
||||
return walletResponse;
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
package com.sparrowwallet.sparrow.whirlpool.dataSource;
|
||||
|
||||
import com.samourai.wallet.api.backend.MinerFee;
|
||||
import com.samourai.wallet.api.backend.MinerFeeTarget;
|
||||
import com.samourai.whirlpool.client.wallet.data.minerFee.MinerFeeSupplier;
|
||||
import com.sparrowwallet.sparrow.AppServices;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class SparrowMinerFeeSupplier implements MinerFeeSupplier {
|
||||
private static final int FALLBACK_FEE_RATE = 75;
|
||||
|
@ -30,15 +32,6 @@ public class SparrowMinerFeeSupplier implements MinerFeeSupplier {
|
|||
return getMinimumFeeForTarget(Integer.parseInt(feeTarget.getValue()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public MinerFee getValue() {
|
||||
Map<String, Integer> fees = new LinkedHashMap<>();
|
||||
for (MinerFeeTarget minerFeeTarget : MinerFeeTarget.values()) {
|
||||
fees.put(minerFeeTarget.getValue(), getFee(minerFeeTarget));
|
||||
}
|
||||
return new MinerFee(fees);
|
||||
}
|
||||
|
||||
private Integer getMinimumFeeForTarget(int targetBlocks) {
|
||||
List<Map.Entry<Integer, Double>> feeRates = new ArrayList<>(AppServices.getTargetBlockFeeRates().entrySet());
|
||||
Collections.reverse(feeRates);
|
||||
|
|
|
@ -89,11 +89,6 @@ public class SparrowWalletStateSupplier implements WalletStateSupplier {
|
|||
// nothing required
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setWalletIndex(WhirlpoolAccount whirlpoolAccount, AddressType addressType, Chain chain, int i) throws Exception {
|
||||
// nothing required
|
||||
}
|
||||
|
||||
@Override
|
||||
public void load() throws Exception {
|
||||
// nothing required
|
||||
|
|
Loading…
Reference in a new issue