mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-21 22:31:48 +01:00
daemon: fix BIP68 support.
We got the -> second translation wrong by a factor of 512, and also we need to move the median time in our tests otherwise bitcoind won't let us spend the tx. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
e44a7dc2d5
commit
40b14981fd
2 changed files with 5 additions and 2 deletions
|
@ -66,7 +66,7 @@ u32 rel_locktime_to_seconds(const struct rel_locktime *rel)
|
|||
{
|
||||
assert(rel_locktime_is_seconds(rel));
|
||||
#if HAS_BIP68
|
||||
return rel->locktime & BIP68_LOCKTIME_MASK;
|
||||
return (rel->locktime & BIP68_LOCKTIME_MASK) << BIP68_SECONDS_SHIFT;
|
||||
#else
|
||||
return rel->locktime - SECONDS_POINT;
|
||||
#endif
|
||||
|
|
|
@ -224,8 +224,11 @@ if [ -n "$TIMEOUT_ANCHOR" ]; then
|
|||
TIME=$(($TIME + 24 * 60 * 60))
|
||||
lcli1 dev-mocktime $TIME
|
||||
|
||||
# Move bitcoind median time as well, so CSV moves.
|
||||
$CLI setmocktime $TIME
|
||||
$CLI generate 6
|
||||
|
||||
# Due to laziness, we trigger by block generation.
|
||||
$CLI generate 1
|
||||
TIME=$(($TIME + 1))
|
||||
lcli1 dev-mocktime $TIME
|
||||
sleep 2
|
||||
|
|
Loading…
Add table
Reference in a new issue