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

syncTree() could use one more log message #660

Closed
pinheadmz opened this issue Nov 13, 2021 · 1 comment · Fixed by #669
Closed

syncTree() could use one more log message #660

pinheadmz opened this issue Nov 13, 2021 · 1 comment · Fixed by #669
Labels
Good first issue issues - beginners and people unfamiliar with code

Comments

@pinheadmz
Copy link
Member

This function can take several seconds and should log something before it starts so impatient users don't think their process is borked:

hsd/lib/blockchain/chain.js

Lines 124 to 154 in e8c9632

/**
* Sync tree state.
*/
async syncTree() {
const {treeInterval} = this.network.names;
const last = this.height - (this.height % treeInterval);
for (let height = last + 1; height <= this.height; height++) {
const entry = await this.db.getEntryByHeight(height);
assert(entry);
const block = await this.db.getBlock(entry.hash);
assert(block);
const state = await this.readDeploymentState(entry);
assert(state);
const view = new CoinView();
const hardened = state.hasHardening();
for (const tx of block.txs)
await this.verifyCovenants(tx, view, height, hardened);
assert((height % this.network.names.treeInterval) !== 0);
await this.db.saveNames(view, entry, false);
}
this.logger.info('Synchronized Tree Root: %x.', this.db.txn.rootHash());
}

@nodech nodech added Good first issue issues - beginners and people unfamiliar with code and removed good first issue labels Nov 18, 2021
@pinheadmz
Copy link
Member Author

closed by #668

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Good first issue issues - beginners and people unfamiliar with code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants