+ bump_candidates.insert(*package_id, request.clone());
+ // If we have any pending claim events for the request being updated
+ // that have yet to be consumed, we'll remove them since they will
+ // end up producing an invalid transaction by double spending
+ // input(s) that already have a confirmed spend. If such spend is
+ // reorged out of the chain, then we'll attempt to re-spend the
+ // inputs once we see it.
+ #[cfg(anchors)] {
+ #[cfg(debug_assertions)] {
+ let existing = self.pending_claim_events.iter()
+ .filter(|entry| entry.0 == *package_id).count();
+ assert!(existing == 0 || existing == 1);
+ }
+ self.pending_claim_events.retain(|entry| entry.0 != *package_id);
+ }