Skip to content

Commit 077b8e8

Browse files
authored
Merge pull request #273 from ariard/2018-12-17-replace-by-permanent-channel-failure
Replace some unknown_next_peer by permanent_channel_failure
2 parents 832fc4f + b1712eb commit 077b8e8

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/ln/channelmanager.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -662,8 +662,7 @@ impl ChannelManager {
662662
}
663663
};
664664
for htlc_source in failed_htlcs.drain(..) {
665-
// unknown_next_peer...I dunno who that is anymore....
666-
self.fail_htlc_backwards_internal(self.channel_state.lock().unwrap(), htlc_source.0, &htlc_source.1, HTLCFailReason::Reason { failure_code: 0x4000 | 10, data: Vec::new() });
665+
self.fail_htlc_backwards_internal(self.channel_state.lock().unwrap(), htlc_source.0, &htlc_source.1, HTLCFailReason::Reason { failure_code: 0x4000 | 8, data: Vec::new() });
667666
}
668667
let chan_update = if let Some(chan) = chan_option {
669668
if let Ok(update) = self.get_channel_update(&chan) {
@@ -686,8 +685,7 @@ impl ChannelManager {
686685
let (local_txn, mut failed_htlcs) = shutdown_res;
687686
log_trace!(self, "Finishing force-closure of channel with {} transactions to broadcast and {} HTLCs to fail", local_txn.len(), failed_htlcs.len());
688687
for htlc_source in failed_htlcs.drain(..) {
689-
// unknown_next_peer...I dunno who that is anymore....
690-
self.fail_htlc_backwards_internal(self.channel_state.lock().unwrap(), htlc_source.0, &htlc_source.1, HTLCFailReason::Reason { failure_code: 0x4000 | 10, data: Vec::new() });
688+
self.fail_htlc_backwards_internal(self.channel_state.lock().unwrap(), htlc_source.0, &htlc_source.1, HTLCFailReason::Reason { failure_code: 0x4000 | 8, data: Vec::new() });
691689
}
692690
for tx in local_txn {
693691
self.tx_broadcaster.broadcast_transaction(&tx);
@@ -1971,8 +1969,7 @@ impl ChannelManager {
19711969
}
19721970
};
19731971
for htlc_source in dropped_htlcs.drain(..) {
1974-
// unknown_next_peer...I dunno who that is anymore....
1975-
self.fail_htlc_backwards_internal(self.channel_state.lock().unwrap(), htlc_source.0, &htlc_source.1, HTLCFailReason::Reason { failure_code: 0x4000 | 10, data: Vec::new() });
1972+
self.fail_htlc_backwards_internal(self.channel_state.lock().unwrap(), htlc_source.0, &htlc_source.1, HTLCFailReason::Reason { failure_code: 0x4000 | 8, data: Vec::new() });
19761973
}
19771974
if let Some(chan) = chan_option {
19781975
if let Ok(update) = self.get_channel_update(&chan) {
@@ -2654,7 +2651,7 @@ impl events::MessageSendEventsProvider for ChannelManager {
26542651
self.claim_funds_internal(self.channel_state.lock().unwrap(), htlc_update.source, preimage);
26552652
} else {
26562653
log_trace!(self, "Failing HTLC with hash {} from our monitor", log_bytes!(htlc_update.payment_hash.0));
2657-
self.fail_htlc_backwards_internal(self.channel_state.lock().unwrap(), htlc_update.source, &htlc_update.payment_hash, HTLCFailReason::Reason { failure_code: 0x4000 | 10, data: Vec::new() });
2654+
self.fail_htlc_backwards_internal(self.channel_state.lock().unwrap(), htlc_update.source, &htlc_update.payment_hash, HTLCFailReason::Reason { failure_code: 0x4000 | 8, data: Vec::new() });
26582655
}
26592656
}
26602657
}
@@ -2679,7 +2676,7 @@ impl events::EventsProvider for ChannelManager {
26792676
self.claim_funds_internal(self.channel_state.lock().unwrap(), htlc_update.source, preimage);
26802677
} else {
26812678
log_trace!(self, "Failing HTLC with hash {} from our monitor", log_bytes!(htlc_update.payment_hash.0));
2682-
self.fail_htlc_backwards_internal(self.channel_state.lock().unwrap(), htlc_update.source, &htlc_update.payment_hash, HTLCFailReason::Reason { failure_code: 0x4000 | 10, data: Vec::new() });
2679+
self.fail_htlc_backwards_internal(self.channel_state.lock().unwrap(), htlc_update.source, &htlc_update.payment_hash, HTLCFailReason::Reason { failure_code: 0x4000 | 8, data: Vec::new() });
26832680
}
26842681
}
26852682
}

0 commit comments

Comments
 (0)