mirror of
https://github.com/lightningdevkit/rust-lightning.git
synced 2025-03-15 15:39:09 +01:00
Fix the err msg provided when a send fails due to peer disconnected
We haven't had a `MonitorUpdateInProgress` check in `Channel::is_live` for some time.
This commit is contained in:
parent
d0b8f455fe
commit
5be29c6add
3 changed files with 5 additions and 5 deletions
|
@ -295,7 +295,7 @@ fn check_api_err(api_err: APIError) {
|
|||
// all others. If you hit this panic, the list of acceptable errors
|
||||
// is probably just stale and you should add new messages here.
|
||||
match err.as_str() {
|
||||
"Peer for first hop currently disconnected/pending monitor update!" => {},
|
||||
"Peer for first hop currently disconnected" => {},
|
||||
_ if err.starts_with("Cannot push more than their max accepted HTLCs ") => {},
|
||||
_ if err.starts_with("Cannot send value that would put us over the max HTLC value in flight our peer will accept ") => {},
|
||||
_ if err.starts_with("Cannot send value that would put our balance under counterparty-announced channel reserve value") => {},
|
||||
|
|
|
@ -2390,10 +2390,10 @@ where
|
|||
let mut peer_state_lock = peer_state_mutex.lock().unwrap();
|
||||
let peer_state = &mut *peer_state_lock;
|
||||
if let hash_map::Entry::Occupied(mut chan) = peer_state.channel_by_id.entry(id) {
|
||||
if !chan.get().is_live() {
|
||||
return Err(APIError::ChannelUnavailable{err: "Peer for first hop currently disconnected".to_owned()});
|
||||
}
|
||||
match {
|
||||
if !chan.get().is_live() {
|
||||
return Err(APIError::ChannelUnavailable{err: "Peer for first hop currently disconnected/pending monitor update!".to_owned()});
|
||||
}
|
||||
break_chan_entry!(self, chan.get_mut().send_htlc_and_commit(
|
||||
htlc_msat, payment_hash.clone(), htlc_cltv, HTLCSource::OutboundRoute {
|
||||
path: path.clone(),
|
||||
|
|
|
@ -258,7 +258,7 @@ fn no_pending_leak_on_initial_send_failure() {
|
|||
|
||||
unwrap_send_err!(nodes[0].node.send_payment(&route, payment_hash, &Some(payment_secret), PaymentId(payment_hash.0)),
|
||||
true, APIError::ChannelUnavailable { ref err },
|
||||
assert_eq!(err, "Peer for first hop currently disconnected/pending monitor update!"));
|
||||
assert_eq!(err, "Peer for first hop currently disconnected"));
|
||||
|
||||
assert!(!nodes[0].node.has_pending_payments());
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue