global: snapshot

This commit is contained in:
nym21
2026-03-10 01:13:52 +01:00
parent 961dea6934
commit 46ac55d950
121 changed files with 9792 additions and 5997 deletions

View File

@@ -39,7 +39,7 @@ impl Query {
}
pub fn blocks(&self, start_height: Option<Height>) -> Result<Vec<BlockInfo>> {
let max_height = self.height();
let max_height = self.indexed_height();
let start = start_height.unwrap_or(max_height);
let start = start.min(max_height);

View File

@@ -10,7 +10,7 @@ impl Query {
let indexer = self.indexer();
let computer = self.computer();
let max_height = self.height();
let max_height = self.indexed_height();
let max_height_usize: usize = max_height.into();
if max_height_usize == 0 {

View File

@@ -26,7 +26,7 @@ impl Query {
fn block_txids_by_height(&self, height: Height) -> Result<Vec<Txid>> {
let indexer = self.indexer();
let max_height = self.height();
let max_height = self.indexed_height();
if height > max_height {
return Err(Error::OutOfRange("Block height out of range".into()));
}
@@ -55,7 +55,7 @@ impl Query {
fn block_txs_by_height(&self, height: Height, start_index: usize) -> Result<Vec<Transaction>> {
let indexer = self.indexer();
let max_height = self.height();
let max_height = self.indexed_height();
if height > max_height {
return Err(Error::OutOfRange("Block height out of range".into()));
}
@@ -97,7 +97,7 @@ impl Query {
fn block_txid_at_index_by_height(&self, height: Height, index: usize) -> Result<Txid> {
let indexer = self.indexer();
let max_height = self.height();
let max_height = self.indexed_height();
if height > max_height {
return Err(Error::OutOfRange("Block height out of range".into()));
}