-
Notifications
You must be signed in to change notification settings - Fork 30
Description
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.