Skip to content

p2p: export bootstrap sync-progress accessors - #130

Open
moralpriest wants to merge 1 commit into
DEROFDN:community-devfrom
moralpriest:feat/sync-progress-accessors
Open

p2p: export bootstrap sync-progress accessors#130
moralpriest wants to merge 1 commit into
DEROFDN:community-devfrom
moralpriest:feat/sync-progress-accessors

Conversation

@moralpriest

Copy link
Copy Markdown

Exposes the bootstrap progress state that bootstrap_chain() already tracks (p2p/chain_bootstrap.go), which is currently package-private.

func GetSyncProgress() (height, chunk int64, step uint)
func IsBootstrapActive() bool

What

  • GetSyncProgress() returns the current state.Height, state.Chunk, state.Step
  • IsBootstrapActive() reports whether a bootstrap is in flight

Why
External consumers have no way to render real bootstrap progress today — block height alone is misleading during tree downloads. Wallet UIs (e.g. TUI wallets) need chunk-level visibility to show honest progress bars.

Pure addition: read-only access to existing fields, zero behavior change, no new dependencies.

Originated during review of #59; shipping separately as agreed there since it's independent of the pipelining work.

GetSyncProgress and IsBootstrapActive expose the progress state that
bootstrap_chain already maintains (package-private sync_progress), so
external consumers such as wallet UIs can render real chunk-level
bootstrap progress instead of guessing from block height.

Pure addition: read-only access to existing fields.
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.

1 participant