feat(chain)!: make KeychainTxOutIndex more range based

`KeychainTxOutIndex` should try and avoid "all" kind of queries.
There may be subranges of interest. If the user wants "all" they can
just query "..".
This commit is contained in:
LLFourn
2024-02-06 17:31:22 +11:00
committed by 志宇
parent ee21ffeee0
commit fac228337c
6 changed files with 94 additions and 78 deletions

View File

@@ -210,8 +210,8 @@ fn main() -> anyhow::Result<()> {
if all_spks {
let all_spks = graph
.index
.revealed_spks()
.map(|(k, i, spk)| (k, i, spk.to_owned()))
.revealed_spks(..)
.map(|(k, i, spk)| (k.to_owned(), i, spk.to_owned()))
.collect::<Vec<_>>();
spks = Box::new(spks.chain(all_spks.into_iter().map(|(k, i, spk)| {
eprintln!("scanning {}:{}", k, i);

View File

@@ -241,8 +241,8 @@ fn main() -> anyhow::Result<()> {
if *all_spks {
let all_spks = graph
.index
.revealed_spks()
.map(|(k, i, spk)| (k, i, spk.to_owned()))
.revealed_spks(..)
.map(|(k, i, spk)| (k.to_owned(), i, spk.to_owned()))
.collect::<Vec<_>>();
spks = Box::new(spks.chain(all_spks.into_iter().map(|(k, i, spk)| {
eprintln!("scanning {}:{}", k, i);