You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
... for ChannelError and APIMisuseError
Before this commit, When rl returns error, we don't know
The actual parameter which caused the error.
By returning parameterised `String` instead of predefined `&'static str`,
We can give a caller improved error message.
TestLogger now has two additional methods
1. `assert_log_contains` which checks the logged messsage
has entry which includes the specified string as a substring.
2. `aasert_log_regex` mostly same with above but it is more flexible
that caller specifies regex which has to be satisfied instead of
just a substring.
For regex, tests now includes `regex` as dev-dependency.
returnErr(LightningError{err:"Channel announcement keys didn't match on-chain script",action:ErrorAction::IgnoreError});
101
+
returnErr(LightningError{err:format!("Channel announcement key({}) didn't match on-chain script ({})", script_pubkey.to_hex(), expected_script.to_hex()),action:ErrorAction::IgnoreError});
101
102
}
102
103
//TODO: Check if value is worth storing, use it to inform routing, and compare it
103
104
//to the new HTLC max field in channel_update
@@ -108,10 +109,10 @@ impl<C: Deref + Sync + Send, L: Deref + Sync + Send> RoutingMessageHandler for N
108
109
false
109
110
},
110
111
Err(ChainError::NotWatched) => {
111
-
returnErr(LightningError{err:"Channel announced on an unknown chain",action:ErrorAction::IgnoreError});
112
+
returnErr(LightningError{err:format!("Channel announced on an unknown chain ({})", msg.contents.chain_hash.encode().to_hex()),action:ErrorAction::IgnoreError});
112
113
},
113
114
Err(ChainError::UnknownTx) => {
114
-
returnErr(LightningError{err:"Channel announced without corresponding UTXO entry",action:ErrorAction::IgnoreError});
115
+
returnErr(LightningError{err:"Channel announced without corresponding UTXO entry".to_owned(),action:ErrorAction::IgnoreError});
115
116
},
116
117
};
117
118
let result = self.network_graph.write().unwrap().update_channel_from_announcement(msg, checked_utxo,Some(&self.secp_ctx));
@@ -522,11 +523,11 @@ impl NetworkGraph {
522
523
}
523
524
524
525
matchself.nodes.get_mut(&msg.contents.node_id){
525
-
None => Err(LightningError{err:"No existing channels for node_announcement",action:ErrorAction::IgnoreError}),
526
+
None => Err(LightningError{err:"No existing channels for node_announcement".to_owned(),action:ErrorAction::IgnoreError}),
let new_entry = match dist.remove(&res.last().unwrap().pubkey){
376
376
Some(hop) => hop.3,
377
-
None => returnErr(LightningError{err:"Failed to find a non-fee-overflowing path to the given destination",action:ErrorAction::IgnoreError}),
377
+
None => returnErr(LightningError{err:"Failed to find a non-fee-overflowing path to the given destination".to_owned(),action:ErrorAction::IgnoreError}),
0 commit comments