- // This can only happen if the channel isn't in the fully-funded
- // state yet, implying our counterparty is trying to route payments
- // over the channel back to themselves (cause no one else should
- // know the short_id is a lightning channel yet). We should have no
- // problem just calling this unknown_next_peer
- onion_utils::build_first_hop_failure_packet(&incoming_shared_secret, 0x4000|10, &[])
- },
- }));
+ // The only case where we'd be unable to
+ // successfully get a channel update is if the
+ // channel isn't in the fully-funded state yet,
+ // implying our counterparty is trying to route
+ // payments over the channel back to themselves
+ // (cause no one else should know the short_id
+ // is a lightning channel yet). We should have
+ // no problem just calling this
+ // unknown_next_peer (0x4000|10).
+ onion_utils::build_first_hop_failure_packet(incoming_shared_secret, 0x4000|10, &[])
+ };
+ let msg = msgs::UpdateFailHTLC {
+ channel_id: msg.channel_id,
+ htlc_id: msg.htlc_id,
+ reason
+ };
+ PendingHTLCStatus::Fail(HTLCFailureMsg::Relay(msg))
+ },
+ _ => pending_forward_info