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

chain: fix hsk_chain_maybe_sync #103

Closed
wants to merge 1 commit into from

Conversation

buffrr
Copy link
Contributor

@buffrr buffrr commented Oct 23, 2022

This is a small PR to fix hsk_chain_maybe_sync. When this function is called the first time, it sets chain->synced = true. So all sync checking logic afterwards gets skipped:

hnsd/src/chain.c

Lines 265 to 269 in cf19505

if (now < HSK_LAUNCH_DATE) {
hsk_chain_log(chain, "chain is fully synced\n");
chain->synced = true;
return;
}

If you were wondering why you see this in the logs it's because of that ^.

chain (0): chain is fully synced

I think this was just old code before mainnet launch. After removing it, hnsd will refuse to answer requests until it's fully synced which is neat! Answering queries without waiting to sync is problematic due to cache poisoning from old records ... etc. Fingertip mitigates that by trying to guess the synced state but hnsd should ideally do it.

pool: sending proof request for: proofofconcept.
pool: cannot send proof request: chain not synced.

@pinheadmz pinheadmz added this to the v2.0.0 milestone Oct 24, 2022
@pinheadmz
Copy link
Member

cherry-picked this into #102

We can merge it there as part of the HS interface.

THANKS BRUH!

@pinheadmz pinheadmz closed this Oct 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants