<p></p>
<p><b>@sqrrm</b> commented on this pull request.</p>
<hr>
<p>In <a href="https://github.com/bisq-network/bisq/pull/4858#discussion_r533723729">core/src/main/java/bisq/core/api/CoreWalletsService.java</a>:</p>
<pre style='color:#555'>> @@ -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.
</pre>
<p>I was thinking something like, in CoreWalletService</p>
<pre><code> TxFeeRateInfo getTxFeeRate(ResultHandler resultHandler, ErrorMessageHandler errorMessageHandler) {
CompletableFuture<Void> feeRequestFuture = CompletableFuture.runAsync(feeService::requestFees);
Futures.addCallback(feeRequestFuture, new FutureCallback<>() {
@Override
public void onSuccess(@Nullable Object result) {
resultHandler.handleResult();
}
@Override
public void onFailure(Throwable t) {
errorMessageHandler.handleErrorMessage(t.getMessage());
}
}, MoreExecutors.directExecutor());
}
</code></pre>
<p>where the resultHandler is doing the gRPC reply, something like</p>
<pre><code> @Override
public void getTxFeeRate(GetTxFeeRateRequest req,
StreamObserver<GetTxFeeRateReply> responseObserver) {
ResultHandler resultHandler = () -> {
var reply = GetTxFeeRateReply.newBuilder()
.setTxFeeRateInfo(txFeeRateInfo.toProtoMessage())
.build();
responseObserver.onNext(reply);
responseObserver.onCompleted();
};
coreApi.getTxFeeRate(resultHandler, errorHandler);
}
</code></pre>
<p>Bad code, just to illustrate the idea.</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/bisq-network/bisq/pull/4858#discussion_r533723729">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AJFFTNXNYUSKEXBW5ZNFOZTSSVLYRANCNFSM4UEFZYHQ">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AJFFTNQK3IJNWY2SX7FFMYTSSVLYRA5CNFSM4UEFZYH2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOEBJNGHQ.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/bisq-network/bisq/pull/4858#discussion_r533723729",
"url": "https://github.com/bisq-network/bisq/pull/4858#discussion_r533723729",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>