Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update predicate scanning status on every trigger #603

Merged
merged 2 commits into from
Jun 18, 2024

Conversation

MicaiahReid
Copy link
Contributor

The predicate status is used to report data to users and to pick back up where the service left off on a restart. This change updates the scanning predicate status to be updated on every successful trigger of a scanning predicate, to be sure we don't scan blocks twice on a restart (if the status was set to a previous block, we'd start on that block at startup)

Copy link
Collaborator

@rafaelcr rafaelcr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -177,6 +183,7 @@ pub async fn scan_bitcoin_chainstate_via_rpc_using_predicate(
Ok(actions) => {
if actions > 0 {
number_of_times_triggered += 1;
loop_did_trigger = true
Copy link
Contributor

@csgui csgui Jun 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Related to my previous comment: aren't these variables interchangeable?

@csgui
Copy link
Contributor

csgui commented Jun 11, 2024

Hey @MicaiahReid ! Not sure if I understand the need of a new control variable. Can't number_of_times_triggered be used as a condition for the same purpose? Tks.

Copy link
Contributor

@csgui csgui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM!

components/chainhook-cli/src/scan/bitcoin.rs Show resolved Hide resolved
@MicaiahReid MicaiahReid force-pushed the chore/update-status-on-trigger branch from a58f9ee to 1c73b76 Compare June 18, 2024 14:03
@MicaiahReid MicaiahReid temporarily deployed to Development-mainnet June 18, 2024 14:40 — with GitHub Actions Inactive
@MicaiahReid MicaiahReid temporarily deployed to Development-testnet June 18, 2024 14:40 — with GitHub Actions Inactive
@MicaiahReid MicaiahReid merged commit a161034 into main Jun 18, 2024
16 checks passed
@MicaiahReid MicaiahReid deleted the chore/update-status-on-trigger branch June 18, 2024 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants