mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-20 07:34:24 +01:00
BIP68 support (nSequence enforcement)
The latest version of the BIP doesn't use inversion, but does use bitshifts. It also uncovered a bug in the test scripts: the block timestamps creep forward when we generate large numbers of blocks (UpdateTime insists it be > GetMedianTimePast() so it's valid). We need to take this into account when waiting for the median to move (reduced it from 60 to 30 seconds, since that adds about 14 seconds). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -99,8 +99,7 @@ int main(int argc, char *argv[])
|
||||
tx->input[0].input_amount = commit->output[p2sh_out].amount;
|
||||
tx->fee = fee;
|
||||
|
||||
/* Sequence number is inverted timeout. */
|
||||
tx->input[0].sequence_number = ~locktime;
|
||||
tx->input[0].sequence_number = bitcoin_nsequence(locktime);
|
||||
|
||||
if (commit->output[p2sh_out].amount <= fee)
|
||||
errx(1, "Amount of %llu won't exceed fee",
|
||||
|
||||
Reference in New Issue
Block a user