+ ConnectStyle::TransactionsFirst|ConnectStyle::TransactionsFirstSkippingBlocks|
+ ConnectStyle::TransactionsDuplicativelyFirstSkippingBlocks|ConnectStyle::HighlyRedundantTransactionsFirstSkippingBlocks|
+ ConnectStyle::TransactionsFirstReorgsOnlyTip => {
+ if *node.connect_style.borrow() == ConnectStyle::HighlyRedundantTransactionsFirstSkippingBlocks {
+ let mut connections = Vec::new();
+ for (block, height) in node.blocks.lock().unwrap().iter() {
+ if !block.txdata.is_empty() {
+ // Reconnect all transactions we've ever seen to ensure transaction connection
+ // is *really* idempotent. This is a somewhat likely deployment for some
+ // esplora implementations of chain sync which try to reduce state and
+ // complexity as much as possible.
+ //
+ // Sadly we have to clone the block here to maintain lockorder. In the
+ // future we should consider Arc'ing the blocks to avoid this.
+ connections.push((block.clone(), *height));
+ }
+ }
+ for (old_block, height) in connections {
+ node.chain_monitor.chain_monitor.transactions_confirmed(&old_block.header,
+ &old_block.txdata.iter().enumerate().collect::<Vec<_>>(), height);
+ }
+ }