mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-05-19 22:34:46 -07:00
global: fixes
This commit is contained in:
@@ -42,8 +42,6 @@ impl TxRemoval {
|
||||
.collect()
|
||||
}
|
||||
|
||||
/// `Replaced` if any of `tx`'s inputs is now claimed by a freshly
|
||||
/// added tx (BIP-125 inferred); otherwise `Vanished`.
|
||||
fn find_removal(tx: &Transaction, spent_by: &SpentBy) -> Self {
|
||||
tx.input
|
||||
.iter()
|
||||
|
||||
@@ -43,9 +43,6 @@ impl Linearizer {
|
||||
.collect()
|
||||
}
|
||||
|
||||
/// Singleton clusters bypass SFL: there's only one ordering. Larger
|
||||
/// clusters are linearized into chunks, each chunk becoming a Package
|
||||
/// with its order index recorded for downstream stability.
|
||||
fn pack_cluster(cluster: &Cluster, cluster_id: u32) -> Vec<Package> {
|
||||
if cluster.nodes.len() == 1 {
|
||||
return vec![Package::singleton(cluster, cluster_id)];
|
||||
|
||||
@@ -45,8 +45,7 @@ impl EntryPool {
|
||||
}
|
||||
|
||||
/// Direct children of a transaction (txs whose `depends` includes
|
||||
/// `prefix`). Derived on demand via a linear scan, called only by
|
||||
/// the CPFP query endpoint, which is not on the hot path.
|
||||
/// `prefix`). Linear scan over all entries.
|
||||
pub fn children(&self, prefix: &TxidPrefix) -> SmallVec<[TxidPrefix; 2]> {
|
||||
self.entries
|
||||
.iter()
|
||||
|
||||
@@ -36,16 +36,12 @@ impl TxStore {
|
||||
self.promote_recent(new_recent);
|
||||
}
|
||||
|
||||
/// Append to the cap-bounded sample buffer if there's room. The
|
||||
/// pre-cap window becomes the next `recent()` value.
|
||||
fn sample_recent(buf: &mut Vec<MempoolRecentTx>, txid: &Txid, tx: &Transaction) {
|
||||
if buf.len() < RECENT_CAP {
|
||||
buf.push(MempoolRecentTx::from((txid, tx)));
|
||||
}
|
||||
}
|
||||
|
||||
/// Record `txid` in the unresolved set if any input lacks a
|
||||
/// prevout. Cleared later by `apply_fills` once all inputs fill.
|
||||
fn track_unresolved(&mut self, txid: &Txid, tx: &Transaction) {
|
||||
if tx.input.iter().any(|i| i.prevout.is_none()) {
|
||||
self.unresolved.insert(txid.clone());
|
||||
@@ -96,9 +92,6 @@ impl TxStore {
|
||||
applied
|
||||
}
|
||||
|
||||
/// Apply each `(vin, prevout)` to its empty input slot. Skips vins
|
||||
/// that are out of range or already filled. Returns the prevouts
|
||||
/// that were actually written.
|
||||
fn write_prevouts(tx: &mut Transaction, fills: Vec<(Vin, TxOut)>) -> Vec<TxOut> {
|
||||
let mut applied = Vec::with_capacity(fills.len());
|
||||
for (vin, prevout) in fills {
|
||||
@@ -118,8 +111,6 @@ impl TxStore {
|
||||
tx.total_sigop_cost = tx.total_sigop_cost();
|
||||
}
|
||||
|
||||
/// Drop `txid` from the unresolved set if every input now has a
|
||||
/// prevout. Idempotent if the tx was removed between phases.
|
||||
fn refresh_unresolved(&mut self, txid: &Txid) {
|
||||
if self.txs.get(txid).is_some_and(Self::all_resolved) {
|
||||
self.unresolved.remove(txid);
|
||||
|
||||
Reference in New Issue
Block a user