Update missing/outdated mempool entries for unconfirmed mempool transactions (or all mempool entries when force_refresh is set, during the initial sync or following a chain tip update)
(&mut self, force_refresh: bool)
| 364 | /// Update missing/outdated mempool entries for unconfirmed mempool transactions (or all mempool |
| 365 | /// entries when force_refresh is set, during the initial sync or following a chain tip update) |
| 366 | fn sync_mempool(&mut self, force_refresh: bool) { |
| 367 | let mempool = self.store.mempool_mut(); |
| 368 | |
| 369 | for (txid, opt_entry) in mempool.iter_mut() { |
| 370 | if force_refresh || opt_entry.is_none() { |
| 371 | match self.rpc.get_mempool_entry(txid) { |
| 372 | Ok(rpc_entry) => *opt_entry = Some(rpc_entry.into()), |
| 373 | Err(e) => warn!("failed fetching mempool entry for {}: {}", txid, e), |
| 374 | } |
| 375 | } |
| 376 | } |
| 377 | |
| 378 | // TODO use batch rpc |
| 379 | } |
| 380 | |
| 381 | /// Get historical events that happened at or after `min_block_height`, including unconfirmed, |
| 382 | /// ordered with oldest first. |
no test coverage detected