+ pub fn sync_confirmed_transactions<C: Deref>(
+ &mut self, confirmables: &Vec<C>, confirmed_txs: Vec<ConfirmedTx>,
+ ) where
+ C::Target: Confirm,
+ {
+ for ctx in confirmed_txs {
+ for c in confirmables {
+ c.transactions_confirmed(
+ &ctx.block_header,
+ &[(ctx.pos, &ctx.tx)],
+ ctx.block_height,
+ );
+ }
+
+ self.watched_transactions.remove(&ctx.tx.txid());
+
+ for input in &ctx.tx.input {
+ if let Some(output) = self.watched_outputs.remove(&input.previous_output) {
+ let spent = (ctx.tx.txid(), ctx.block_height, input.previous_output, output);
+ self.outputs_spends_pending_threshold_conf.push(spent);
+ }
+ }
+ }
+ }
+
+ pub fn prune_output_spends(&mut self, cur_height: u32) {
+ self.outputs_spends_pending_threshold_conf
+ .retain(|(_, conf_height, _, _)| cur_height < conf_height + ANTI_REORG_DELAY - 1);
+ }
+}