///
/// Note that the deserializer is only implemented for (Sha256dHash, ChannelMonitor), which
/// tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
- /// the "reorg path" (ie not just starting at the same height but starting at the highest
- /// common block that appears on your best chain as well as on the chain which contains the
- /// last block hash returned) upon deserializing the object!
+ /// the "reorg path" (ie disconnecting blocks until you find a common ancestor from both the
+ /// returned block hash and the the current chain and then reconnecting blocks to get to the
+ /// best chain) upon deserializing the object!
pub fn write_for_disk<W: Writer>(&self, writer: &mut W) -> Result<(), ::std::io::Error> {
//TODO: We still write out all the serialization here manually instead of using the fancy
//serialization framework we have, we should migrate things over to it.
onchain_events_waiting_threshold_conf: HashMap::new(),
outputs_to_watch: HashMap::new(),
- onchain_tx_handler: OnchainTxHandler::new(destination_script.clone(), keys, funding_redeemscript, their_to_self_delay, logger.clone()),
+ onchain_tx_handler: OnchainTxHandler::new(destination_script.clone(), keys, their_to_self_delay, logger.clone()),
lockdown_from_offchain: false,
/// In any-case, choice is up to the user.
pub fn get_latest_local_commitment_txn(&mut self) -> Vec<Transaction> {
log_trace!(self, "Getting signed latest local commitment transaction!");
- if let Some(commitment_tx) = self.onchain_tx_handler.get_fully_signed_local_tx(self.channel_value_satoshis) {
+ if let Some(commitment_tx) = self.onchain_tx_handler.get_fully_signed_local_tx() {
let txid = commitment_tx.txid();
let mut res = vec![commitment_tx];
if let &Some(ref local_tx) = &self.current_local_signed_commitment_tx {
#[cfg(test)]
pub fn unsafe_get_latest_local_commitment_txn(&mut self) -> Vec<Transaction> {
log_trace!(self, "Getting signed copy of latest local commitment transaction!");
- if let Some(commitment_tx) = self.onchain_tx_handler.get_fully_signed_copy_local_tx(self.channel_value_satoshis) {
+ if let Some(commitment_tx) = self.onchain_tx_handler.get_fully_signed_copy_local_tx() {
let txid = commitment_tx.txid();
let mut res = vec![commitment_tx];
if let &Some(ref local_tx) = &self.current_local_signed_commitment_tx {
}
if let Some(ref cur_local_tx) = self.current_local_signed_commitment_tx {
if should_broadcast {
- if let Some(commitment_tx) = self.onchain_tx_handler.get_fully_signed_local_tx(self.channel_value_satoshis) {
+ if let Some(commitment_tx) = self.onchain_tx_handler.get_fully_signed_local_tx() {
let (mut new_outpoints, new_outputs, _) = self.broadcast_by_local_state(&commitment_tx, cur_local_tx);
if !new_outputs.is_empty() {
watch_outputs.push((cur_local_tx.txid.clone(), new_outputs));