mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-05-20 06:44:47 -07:00
query: fixes
This commit is contained in:
@@ -143,13 +143,8 @@ impl Sfl {
|
||||
if nrate <= rate {
|
||||
continue;
|
||||
}
|
||||
match picked {
|
||||
None => picked = Some((add, nf, nv, nrate)),
|
||||
Some((_, _, _, prate)) => {
|
||||
if nrate > prate {
|
||||
picked = Some((add, nf, nv, nrate));
|
||||
}
|
||||
}
|
||||
if picked.is_none_or(|(_, _, _, prate)| nrate > prate) {
|
||||
picked = Some((add, nf, nv, nrate));
|
||||
}
|
||||
}
|
||||
match picked {
|
||||
|
||||
@@ -43,6 +43,15 @@ impl TxGraveyard {
|
||||
})
|
||||
}
|
||||
|
||||
/// Every `Replaced` tombstone, yielded as (predecessor_txid,
|
||||
/// replacer_txid). Caller walks the replacer chain forward to find
|
||||
/// each tree's terminal replacer.
|
||||
pub fn replaced_iter(&self) -> impl Iterator<Item = (&Txid, &Txid)> {
|
||||
self.tombstones
|
||||
.iter()
|
||||
.filter_map(|(txid, ts)| ts.replaced_by().map(|by| (txid, by)))
|
||||
}
|
||||
|
||||
pub fn bury(&mut self, txid: Txid, tx: Transaction, entry: TxEntry, removal: TxRemoval) {
|
||||
let now = Instant::now();
|
||||
self.tombstones
|
||||
|
||||
Reference in New Issue
Block a user