use core::cmp;
use core::ops::Deref;
use core::mem::replace;
+#[cfg(anchors)]
+use core::mem::swap;
use bitcoin::hashes::Hash;
const MAX_ALLOC_SIZE: usize = 64*1024;
self.holder_commitment.to_broadcaster_value_sat()
}
+ #[cfg(anchors)]
+ pub(crate) fn get_and_clear_pending_claim_events(&mut self) -> Vec<ClaimEvent> {
+ let mut ret = HashMap::new();
+ swap(&mut ret, &mut self.pending_claim_events);
+ ret.into_iter().map(|(_, event)| event).collect::<Vec<_>>()
+ }
+
/// Lightning security model (i.e being able to redeem/timeout HTLC or penalize counterparty
/// onchain) lays on the assumption of claim transactions getting confirmed before timelock
/// expiration (CSV or CLTV following cases). In case of high-fee spikes, claim tx may get stuck