Skip to content

add bool for exact expiry on receive APIs #37

@nicbus

Description

@nicbus

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions