Skip to content

last_will example assumes wrong block duration for Elements #396

Description

@schoen

Project version

0.7.0

Project

other

What happened?

The last_will.simf declares a Distance value

    let days_180: Distance = 25920;

However, this is 180 days only if this contract were running on Bitcoin Core where the average blocktime is 10 minutes (259200 minutes is 180 days). On Elements, the blocktime is 1 minute, so the inheritor can actually inherit in this example after 18 days of testator inactivity, not 180 days.

The maximum time that can be asserted on Elements with a Distance is 65535 blocks of 1 minute each, or about 45.5 days. Beyond that, one would use a Duration instead. See the timelock documentation for details.

Minimal reproduction steps

See timelocks documentation and compare to last_will.simf code.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions