@@ -4629,23 +4629,22 @@ where
4629
4629
/// If there is an error, all channels in the batch are to be considered closed.
4630
4630
pub fn batch_funding_transaction_generated(&self, temporary_channels: &[(&ChannelId, &PublicKey)], funding_transaction: Transaction) -> Result<(), APIError> {
4631
4631
let _persistence_guard = PersistenceNotifierGuard::notify_on_drop(self);
4632
- let mut result = Ok(());
4633
-
4634
- if !funding_transaction.is_coinbase() {
4635
- for inp in funding_transaction.input.iter() {
4636
- if inp.witness.is_empty() {
4637
- result = result.and(Err(APIError::APIMisuseError {
4638
- err: "Funding transaction must be fully signed and spend Segwit outputs".to_owned()
4639
- }));
4640
- }
4641
- }
4642
- }
4643
- result.and(self.batch_funding_transaction_generated_intern(temporary_channels, FundingType::Checked(funding_transaction)))
4632
+ self.batch_funding_transaction_generated_intern(temporary_channels, FundingType::Checked(funding_transaction))
4644
4633
}
4645
4634
4646
4635
fn batch_funding_transaction_generated_intern(&self, temporary_channels: &[(&ChannelId, &PublicKey)], funding: FundingType) -> Result<(), APIError> {
4647
4636
let mut result = Ok(());
4648
4637
if let FundingType::Checked(funding_transaction) = &funding {
4638
+ if !funding_transaction.is_coinbase() {
4639
+ for inp in funding_transaction.input.iter() {
4640
+ if inp.witness.is_empty() {
4641
+ result = result.and(Err(APIError::APIMisuseError {
4642
+ err: "Funding transaction must be fully signed and spend Segwit outputs".to_owned()
4643
+ }));
4644
+ }
4645
+ }
4646
+ }
4647
+
4649
4648
if funding_transaction.output.len() > u16::max_value() as usize {
4650
4649
result = result.and(Err(APIError::APIMisuseError {
4651
4650
err: "Transaction had more than 2^16 outputs, which is not supported".to_owned()
0 commit comments