fix: set is_streaming_blocks to false when scanning (#309)

This commit is contained in:
Rafael Cárdenas
2024-06-04 13:16:47 -06:00
committed by GitHub
parent ae54d0d713
commit b31f6bdea7
2 changed files with 5 additions and 1 deletions

View File

@@ -568,6 +568,7 @@ async fn handle_command(opts: Opts, ctx: &Context) -> Result<(), String> {
Some(&block_heights),
None,
cmd.auth_token,
false,
)?;
let _ = initialize_observers_db(&config.expected_cache_path(), ctx);
@@ -751,6 +752,7 @@ async fn handle_command(opts: Opts, ctx: &Context) -> Result<(), String> {
None,
Some(start_block),
cmd.auth_token.clone(),
true,
)?;
predicates.push(predicate);
}
@@ -965,6 +967,7 @@ pub fn build_predicate_from_cli(
block_heights: Option<&BlockHeights>,
start_block: Option<u64>,
auth_token: Option<String>,
is_streaming: bool,
) -> Result<BitcoinChainhookSpecification, String> {
// Retrieve last block height known, and display it
let (start_block, end_block, blocks) = match (start_block, block_heights) {
@@ -994,7 +997,7 @@ pub fn build_predicate_from_cli(
include_outputs: false,
include_witness: false,
expired_at: None,
enabled: true,
enabled: is_streaming,
predicate: BitcoinPredicateType::OrdinalsProtocol(OrdinalOperations::InscriptionFeed(
InscriptionFeedData { meta_protocols },
)),

View File

@@ -571,6 +571,7 @@ pub fn augment_block_with_ordinals_inscriptions_data_and_write_to_db_tx(
// Handle re-inscriptions
let mut reinscriptions_data = HashMap::new();
for (_, inscription_data) in inscriptions_data.iter() {
// TODO: Comment on why this is necessary.
if inscription_data.ordinal_number != 0 {
if let Some(inscription_id) = find_blessed_inscription_with_ordinal_number(
&inscription_data.ordinal_number,