From 28ea51818209633640bf543e55549deb2feffaae Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Fri, 12 Jun 2015 11:52:21 +0930 Subject: [PATCH] create-steal-tx: use o1 to double-check final key is correct. It's actually an unused parameter, but they symmetry with others in nice. Signed-off-by: Rusty Russell --- create-steal-tx.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/create-steal-tx.c b/create-steal-tx.c index 7497be86b..fb9a1b62e 100644 --- a/create-steal-tx.c +++ b/create-steal-tx.c @@ -76,6 +76,12 @@ int main(int argc, char *argv[]) if (!pubkey_from_hexstr(argv[6], &outpubkey)) errx(1, "Invalid bitcoin pubkey '%s'", argv[6]); + /* Get pubkeys */ + if (!proto_to_pubkey(o1->final, &pubkey2)) + errx(1, "Invalid o1 final pubkey"); + if (pubkey_len(&pubkey1) != pubkey_len(&pubkey2) + || memcmp(pubkey1.key, pubkey2.key, pubkey_len(&pubkey2)) != 0) + errx(1, "o1 pubkey != this privkey"); if (!proto_to_pubkey(o2->final, &pubkey2)) errx(1, "Invalid o2 final pubkey");