permute_tx: reintroduce permute map.

We used to have a permutation map; this reintroduces a variant which
uses the htlc pointers directly.

We need this because we have to send the htlc-tx signatures in output
order as part of the protocol: without two-stage HTLCs we only needed
to wire them up in the unilateral spend case so we simply brute-forced
the ordering.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2017-02-07 12:14:22 +10:30
parent e11d9304ab
commit 0fe53cc8e7
6 changed files with 37 additions and 8 deletions

View File

@@ -218,7 +218,7 @@ struct bitcoin_tx *create_commit_tx(const tal_t *ctx,
assert(total <= peer->anchor.satoshis);
tal_resize(&tx->output, output_count);
permute_outputs(tx->output, tal_count(tx->output));
permute_outputs(tx->output, tal_count(tx->output), NULL);
tal_free(tmpctx);
return tx;
}