Skip to content

Commit 1d42632

Browse files
committed
Correct funding_transaction_generated err msg and fix fuzz check
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).
1 parent deed803 commit 1d42632

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

fuzz/src/full_stack.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -634,11 +634,7 @@ pub fn do_test(data: &[u8], logger: &Arc<dyn Logger>) {
634634
if let Err(e) = channelmanager.funding_transaction_generated(&funding_generation.0, &funding_generation.1, tx.clone()) {
635635
// It's possible the channel has been closed in the mean time, but any other
636636
// failure may be a bug.
637-
if let APIError::ChannelUnavailable { err } = e {
638-
if !err.starts_with("Can't find a peer matching the passed counterparty node_id ") {
639-
assert_eq!(err, "No such channel");
640-
}
641-
} else { panic!(); }
637+
if let APIError::ChannelUnavailable { .. } = e { } else { panic!(); }
642638
}
643639
pending_funding_signatures.insert(funding_output, tx);
644640
}

lightning/src/ln/channelmanager.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2691,7 +2691,7 @@ where
26912691
(chan, funding_msg)
26922692
},
26932693
Err(_) => { return Err(APIError::ChannelUnavailable {
2694-
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()
2694+
err: "Signer refused to sign the initial commitment transaction".to_owned()
26952695
}) },
26962696
}
26972697
};

0 commit comments

Comments
 (0)