[bisq-network/bisq] Add tx fee rate api methods: gettxfeerate, settxfeerate, unsettxfeerate (#4858)

sqrrm notifications at github.com
Tue Dec 1 17:53:20 CET 2020


@sqrrm commented on this pull request.



> +        String customTxFeeRate = txFeeRateInfo.getCustomTxFeeRate() < 0
+                ? formatTxFeeRate(txFeeRateInfo.getCustomTxFeeRate())
+                : null;

I don't understand what's going on here.

> @@ -185,6 +196,37 @@ void sendBsq(String address,
         }
     }
 
+    TxFeeRateInfo getTxFeeRate() {
+        try {
+            CompletableFuture<Void> feeRequestFuture = CompletableFuture.runAsync(feeService::requestFees);
+            feeRequestFuture.get();  // Block until async fee request is complete.

Is it really a good idea to block here? As discussed before, could we use a callback to avoid blocking?

> +            CompletableFuture<Void> feeRequestFuture = CompletableFuture.runAsync(feeService::requestFees);
+            feeRequestFuture.get();  // Block until async fee request is complete.
+        } catch (InterruptedException | ExecutionException e) {
+            throw new IllegalStateException("could not request fees from fee service.", e);
+        }
+
+        Coin stdTxFeeRate = feeService.getTxFeePerVbyte();
+        Coin customTxFeeRate = preferences.isUseCustomWithdrawalTxFee()
+                ? Coin.valueOf(preferences.getWithdrawalTxFeeInVbytes())
+                : Coin.NEGATIVE_SATOSHI;
+
+        return new TxFeeRateInfo(stdTxFeeRate.value, customTxFeeRate.value);
+    }
+
+    TxFeeRateInfo setTxFeeRatePreference(long txFeeRate) {
+        if (txFeeRate <= 0)

We also don't want to create txs with fees < 1 sat/b, but perhaps that doesn't have to be checked here.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq/pull/4858#pullrequestreview-542093586
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20201201/087dbc0f/attachment.htm>


More information about the bisq-github mailing list