[bisq-network/bisq] Add pending callbacks to FeeService (#5528)

sqrrm notifications at github.com
Tue May 25 13:25:08 CEST 2021


This fix guarantees a callback if there is a pending request rather than just
dropping the fee request.

When requestFee() is called the callbacks are added to a list of callBacks.
Once the next fee request completes all callbacks in the list are called
and the list cleared.

<!-- 
- make yourself familiar with the CONTRIBUTING.md if you have not already (https://github.com/bisq-network/bisq/blob/master/CONTRIBUTING.md)
- make sure you follow our [coding style guidelines][https://github.com/bisq-network/style/issues)
- pick a descriptive title
- provide some meaningful PR description below
- create the PR
- in case you receive a "Change request" and/or a NACK, please react within 30 days. If not, we will close your PR and it can not be up for compensation.
- After addressing the change request, __please re-request a review!__ Otherwise we might miss your PR as we tend to only look at pull requests tagged with a "review required".
-->

This issue popped up while testing atomic trades with the API and could likely be an issue for other usages of the API. If requestFees() is called while there is an pending request no callback is called. Since it's expected that either the resultHandler or the faultHandler is called it's not clear what happens for callers relying on the callbacks. This PR adds a guarantee one callback is called.

Also return early for the frequency check.
You can view, comment on, or merge this pull request online at:

  https://github.com/bisq-network/bisq/pull/5528

-- Commit Summary --

  * Add pending callbacks to FeeService

-- File Changes --

    M core/src/main/java/bisq/core/provider/fee/FeeService.java (113)

-- Patch Links --

https://github.com/bisq-network/bisq/pull/5528.patch
https://github.com/bisq-network/bisq/pull/5528.diff

-- 
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/5528
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20210525/4a7684ea/attachment.htm>


More information about the bisq-github mailing list