]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Correct `funding_transaction_generated` err msg and fix fuzz check
authorMatt Corallo <git@bluematt.me>
Wed, 15 Feb 2023 01:23:20 +0000 (01:23 +0000)
committerMatt Corallo <git@bluematt.me>
Tue, 21 Feb 2023 18:54:52 +0000 (18:54 +0000)
This fixes new errors in `full_stack_target` pointed out by
Chaincode's generous fuzzing infrastructure. Specifically, there's
no reason to check the error message in the
`funding_transaction_generated` return value - it can only return
a failure if the channel has closed since the funding transaction
was generated (which is fine) or if the signer refuses to sign
(which can't happen in fuzzing).

fuzz/src/full_stack.rs
lightning/src/ln/channelmanager.rs

index 9b3b76c2b3a7d4e60f9d7354406411b2b42a294f..ca42466880a110e3e0e24873efe85f377a4974ad 100644 (file)
@@ -634,11 +634,7 @@ pub fn do_test(data: &[u8], logger: &Arc<dyn Logger>) {
                                        if let Err(e) = channelmanager.funding_transaction_generated(&funding_generation.0, &funding_generation.1, tx.clone()) {
                                                // It's possible the channel has been closed in the mean time, but any other
                                                // failure may be a bug.
-                                               if let APIError::ChannelUnavailable { err } = e {
-                                                       if !err.starts_with("Can't find a peer matching the passed counterparty node_id ") {
-                                                               assert_eq!(err, "No such channel");
-                                                       }
-                                               } else { panic!(); }
+                                               if let APIError::ChannelUnavailable { .. } = e { } else { panic!(); }
                                        }
                                        pending_funding_signatures.insert(funding_output, tx);
                                }
index a1148b692b102b15754386bfc620a116f4d5fb8d..845e50f7bb51cac9e85aaeaae6784ed8c3487a0c 100644 (file)
@@ -2691,7 +2691,7 @@ where
                                        (chan, funding_msg)
                                },
                                Err(_) => { return Err(APIError::ChannelUnavailable {
-                                       err: "Error deriving keys or signing initial commitment transactions - either our RNG or our counterparty's RNG is broken or the Signer refused to sign".to_owned()
+                                       err: "Signer refused to sign the initial commitment transaction".to_owned()
                                }) },
                        }
                };