Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add bool for exact expiry on receive APIs #37

Open
nicbus opened this issue Nov 28, 2023 · 0 comments
Open

add bool for exact expiry on receive APIs #37

nicbus opened this issue Nov 28, 2023 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@nicbus
Copy link
Collaborator

nicbus commented Nov 28, 2023

Let's add the exact_expiry bool parameter to receive APIs (blind_receive and witness_receive) that determines how an expired transfer should be handled.

When true, an expired transfer should be rejected.
When false, an expired transfer should be accepted anyway.

The current implementation behaves as if this new bool parameter was set to false.

This means that in the _handle_expired_transfers method (called by all APIs that require allocations), instead of immediately setting an expired transfer to the failed status, rgb-lib checks for one last time whether the sender eventually sent the assets and, if so, it accepts the assets even if the transfer has expired. The new behavior will change this when the bool parameter is set to true, by directly setting the expired transfer to the failed status, without checking one last time if the sender sent something.

A similar behavior is seen in the fail_transfers API where, before setting an expired transfer to the failed status, the library performs one last refresh. The updated library should also check whether this new bool parameter has been set to true and, in that case, fail the transfer without refreshing.

@zoedberg zoedberg added enhancement New feature or request good first issue Good for newcomers labels Nov 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants