pkt: add pkt_totlen() helper.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2015-06-12 13:01:50 +09:30
parent 77387bb370
commit 92ec2f874b
11 changed files with 17 additions and 18 deletions

View File

@@ -88,8 +88,7 @@ int main(int argc, char *argv[])
privkey, &pubkey1, &sig);
pkt = open_commit_sig_pkt(ctx, &sig);
if (!write_all(STDOUT_FILENO, pkt,
sizeof(pkt->len) + le32_to_cpu(pkt->len)))
if (!write_all(STDOUT_FILENO, pkt, pkt_totlen(pkt)))
err(1, "Writing out packet");
tal_free(ctx);