async fn scan_pending_mempool(
btc_rpc: &ServerBitcoinRpcMonitor,
pks_hash: &Hash,
budget: Duration,
cache: &mut BTreeMap<Txid, Vec<PendingOutput>>,
) -> MempoolScanExpand description
Collects the receive outputs of the transactions in the node’s mempool.
A pass never fails outright, because the mempool is only ever the weakest half of the pending view: losing it must not cost the mined half, which is the stronger signal and is gathered from a backend that may well still be working. Instead it reports how far it got.
A pass stops fetching once budget has elapsed, after fetching at least one
transaction so that every pass makes progress.
Only transactions absent from cache are fetched, and entries that have
left the mempool are dropped, so eviction and replacement are handled by
rebuilding the retained set rather than by tracking them explicitly. A
transaction that disappears between being listed and being fetched is
skipped rather than treated as an error, since that is the ordinary outcome
of it being mined mid-scan.
cache is never emptied on failure. Refilling it costs one fetch per
mempool transaction, so discarding it because a single call failed would
turn a transient error into repeated bursts of RPC work; whether its
contents may be reported is what the returned MempoolScan decides. A
pass that stops short still reports its cache: it was pruned against a fresh
listing, so every entry in it is real and the set is merely short of a few
transactions.