From 0af04b0576e513d69df1a031591bac9487fe99ea Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 18 Aug 2016 14:23:45 +0930 Subject: [PATCH] peer: use commit_tx's newly exposed witness script helpers. Signed-off-by: Rusty Russell --- daemon/peer.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/daemon/peer.c b/daemon/peer.c index 579bb3612..c37a9a19d 100644 --- a/daemon/peer.c +++ b/daemon/peer.c @@ -581,14 +581,13 @@ static const struct bitcoin_tx *htlc_fulfill_tx(const struct peer *peer, htlc = htlc_by_index(ci, i); assert(htlc->r); - wscript = bitcoin_redeem_htlc_recv(peer, - peer->dstate->secpctx, - &peer->local.finalkey, - &peer->remote.finalkey, - &htlc->expiry, - &peer->remote.locktime, - &ci->revocation_hash, - &htlc->rhash); + wscript = wscript_for_htlc(peer, peer->dstate->secpctx, htlc, + &peer->local.finalkey, + &peer->remote.finalkey, + &peer->local.locktime, + &peer->remote.locktime, + &ci->revocation_hash, + REMOTE); tx->input[0].index = ci->map[i]; bitcoin_txid(ci->tx, &tx->input[0].txid);