onchain_events_waiting_threshold_conf: HashMap::new(),
outputs_to_watch: HashMap::new(),
- onchain_tx_handler: OnchainTxHandler::new(destination_script.clone(), keys, funding_redeemscript, logger.clone()),
+ onchain_tx_handler: OnchainTxHandler::new(destination_script.clone(), keys, funding_redeemscript, their_to_self_delay, logger.clone()),
last_block_hash: Default::default(),
secp_ctx: Secp256k1::new(),
prev_local_commitment: Option<LocalCommitmentTransaction>,
current_htlc_cache: Option<HTLCTxCache>,
prev_htlc_cache: Option<HTLCTxCache>,
+ local_csv: u16,
key_storage: ChanSigner,
} else {
writer.write_all(&[0; 1])?;
}
+ self.local_csv.write(writer)?;
self.key_storage.write(writer)?;
}
_ => return Err(DecodeError::InvalidValue),
};
+ let local_csv = Readable::read(reader)?;
let key_storage = Readable::read(reader)?;
prev_local_commitment,
current_htlc_cache,
prev_htlc_cache,
+ local_csv,
key_storage,
claimable_outpoints,
pending_claim_requests,
}
impl<ChanSigner: ChannelKeys> OnchainTxHandler<ChanSigner> {
- pub(super) fn new(destination_script: Script, keys: ChanSigner, funding_redeemscript: Script, logger: Arc<Logger>) -> Self {
+ pub(super) fn new(destination_script: Script, keys: ChanSigner, funding_redeemscript: Script, local_csv: u16, logger: Arc<Logger>) -> Self {
let key_storage = keys;
prev_local_commitment: None,
current_htlc_cache: None,
prev_htlc_cache: None,
+ local_csv,
key_storage,
pending_claim_requests: HashMap::new(),
claimable_outpoints: HashMap::new(),