channeld: don't assign htlc preimage twice.

channel_fulfill_htlc() does that already.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2018-08-24 16:44:53 +09:30 committed by Christian Decker
parent 11a1ec6e94
commit a3115279fd
1 changed files with 0 additions and 3 deletions

View File

@ -1458,7 +1458,6 @@ static void handle_peer_fulfill_htlc(struct peer *peer, const u8 *msg)
e = channel_fulfill_htlc(peer->channel, LOCAL, id, &preimage, &h);
switch (e) {
case CHANNEL_ERR_REMOVE_OK:
h->r = tal_dup(h, struct preimage, &preimage);
/* FIXME: We could send preimages to master immediately. */
start_commit_timer(peer);
return;
@ -2382,8 +2381,6 @@ static void handle_preimage(struct peer *peer, const u8 *inmsg)
&fulfilled_htlc.payment_preimage,
&h)) {
case CHANNEL_ERR_REMOVE_OK:
h->r = tal_dup(h, struct preimage,
&fulfilled_htlc.payment_preimage);
send_fail_or_fulfill(peer, h);
start_commit_timer(peer);
return;