Fix DER encoding.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2015-06-04 15:46:49 +09:30
parent 623c6562af
commit 17c56a8cfc
7 changed files with 168 additions and 57 deletions

View File

@@ -28,7 +28,7 @@ int main(int argc, char *argv[])
struct bitcoin_tx *anchor, *commit;
struct sha256_double txid;
struct pkt *pkt;
struct signature *sig;
struct signature sig;
size_t *inmap, *outmap;
EC_KEY *privkey;
bool testnet;
@@ -75,10 +75,10 @@ int main(int argc, char *argv[])
(long long)o2->commitment_fee);
/* Sign it for them. */
sig = sign_tx_input(ctx, commit, 0, anchor->output[outmap[0]].script,
anchor->output[outmap[0]].script_length, privkey);
sign_tx_input(ctx, commit, 0, anchor->output[outmap[0]].script,
anchor->output[outmap[0]].script_length, privkey, &sig);
pkt = open_commit_sig_pkt(ctx, sig);
pkt = open_commit_sig_pkt(ctx, &sig);
if (!write_all(STDOUT_FILENO, pkt,
sizeof(pkt->len) + le32_to_cpu(pkt->len)))
err(1, "Writing out packet");