mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-06 07:34:21 +01:00
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:
committed by
Christian Decker
parent
11a1ec6e94
commit
a3115279fd
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user