+ let our_claim_txn_waiting_first_conf_len: u64 = Readable::read(reader)?;
+ let mut our_claim_txn_waiting_first_conf = HashMap::with_capacity(cmp::min(our_claim_txn_waiting_first_conf_len as usize, MAX_ALLOC_SIZE / 128));
+ for _ in 0..our_claim_txn_waiting_first_conf_len {
+ let outpoint = Readable::read(reader)?;
+ let height_target = Readable::read(reader)?;
+ let tx_material = match <u8 as Readable<R>>::read(reader)? {
+ 0 => {
+ let script = Readable::read(reader)?;
+ let pubkey = Readable::read(reader)?;
+ let key = Readable::read(reader)?;
+ let is_htlc = match <u8 as Readable<R>>::read(reader)? {
+ 0 => true,
+ 1 => false,
+ _ => return Err(DecodeError::InvalidValue),
+ };
+ let amount = Readable::read(reader)?;
+ TxMaterial::Revoked {
+ script,
+ pubkey,
+ key,
+ is_htlc,
+ amount
+ }
+ },
+ 1 => {
+ let script = Readable::read(reader)?;
+ let key = Readable::read(reader)?;
+ let preimage = Readable::read(reader)?;
+ let amount = Readable::read(reader)?;
+ TxMaterial::RemoteHTLC {
+ script,
+ key,
+ preimage,
+ amount
+ }
+ },
+ 2 => {
+ let script = Readable::read(reader)?;
+ let their_sig = Readable::read(reader)?;
+ let our_sig = Readable::read(reader)?;
+ let preimage = Readable::read(reader)?;
+ let amount = Readable::read(reader)?;
+ TxMaterial::LocalHTLC {
+ script,
+ sigs: (their_sig, our_sig),
+ preimage,
+ amount
+ }
+ }
+ _ => return Err(DecodeError::InvalidValue),
+ };
+ let last_fee = Readable::read(reader)?;
+ our_claim_txn_waiting_first_conf.insert(outpoint, (height_target, tx_material, last_fee));
+ }
+