proto_to_locktime: abs and relative locktime handlers.

Our current proto_to_locktime actually handles relative locktimes,
and HTLCs use absolute.  Fix that.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2015-08-07 12:45:30 +09:30
parent 7f21695a63
commit 9a0163ec85
5 changed files with 23 additions and 6 deletions

View File

@@ -60,7 +60,7 @@ int main(int argc, char *argv[])
o1 = pkt_from_file(argv[2], PKT__PKT_OPEN)->open;
o2 = pkt_from_file(argv[3], PKT__PKT_OPEN)->open;
a = pkt_from_file(argv[4], PKT__PKT_OPEN_ANCHOR)->open_anchor;
if (!proto_to_locktime(o2->delay, &locktime))
if (!proto_to_rel_locktime(o2->delay, &locktime))
errx(1, "Invalid locktime in o2");
/* We need our private key to spend commit output. */