preimage: Option<PaymentPreimage>,
amount: u64,
},
- Funding {
- channel_value: u64,
- }
+ Funding {}
}
impl Writeable for InputMaterial {
preimage.write(writer)?;
writer.write_all(&byte_utils::be64_to_array(*amount))?;
},
- &InputMaterial::Funding { ref channel_value } => {
+ &InputMaterial::Funding {} => {
writer.write_all(&[3; 1])?;
- channel_value.write(writer)?;
}
}
Ok(())
}
},
3 => {
- let channel_value = Readable::read(reader)?;
- InputMaterial::Funding {
- channel_value
- }
+ InputMaterial::Funding {}
}
_ => return Err(DecodeError::InvalidValue),
};
}
let should_broadcast = self.would_broadcast_at_height(height);
if should_broadcast {
- claimable_outpoints.push(ClaimRequest { absolute_timelock: height, aggregable: false, outpoint: BitcoinOutPoint { txid: self.funding_info.0.txid.clone(), vout: self.funding_info.0.index as u32 }, witness_data: InputMaterial::Funding { channel_value: self.channel_value_satoshis }});
+ claimable_outpoints.push(ClaimRequest { absolute_timelock: height, aggregable: false, outpoint: BitcoinOutPoint { txid: self.funding_info.0.txid.clone(), vout: self.funding_info.0.index as u32 }, witness_data: InputMaterial::Funding {}});
}
if should_broadcast {
if let Some(commitment_tx) = self.onchain_tx_handler.get_fully_signed_local_tx() {
}
return None;
},
- &InputMaterial::Funding { ref channel_value } => {
+ &InputMaterial::Funding {} => {
let signed_tx = self.get_fully_signed_local_tx().unwrap();
- let mut amt_outputs = 0;
- for outp in signed_tx.output.iter() {
- amt_outputs += outp.value;
- }
- let feerate = (channel_value - amt_outputs) * 1000 / signed_tx.get_weight() as u64;
// Timer set to $NEVER given we can't bump tx without anchor outputs
log_trace!(self, "Going to broadcast Local Transaction {} claiming funding output {} from {}...", signed_tx.txid(), outp.vout, outp.txid);
- return Some((None, feerate, signed_tx));
+ return Some((None, self.local_commitment.as_ref().unwrap().feerate_per_kw, signed_tx));
}
_ => unreachable!()
}