Skip to content

Conversation

cfromknecht
Copy link
Contributor

@cfromknecht cfromknecht commented Nov 11, 2017

This PR alters the behavior of the router's logic on startup, ensuring that the chain view is filtered using the router's latest prune height. Before, the chain was filtered using the bestHeight variable, which was uninitialized, benignly forcing a rescan from genesis. In tracking this down, we realized that we should actually be using the prune height, as this is representative of the channel view loaded from disk. The best height/hash are now only used during startup to determine if we are out of sync.

I've also updated the logging statement to be more helpful, and only print to trace 🙂

@cfromknecht cfromknecht force-pushed the router-prevent-rescan branch from 4f5664d to e27a4e0 Compare November 11, 2017 03:02
Copy link
Contributor

@halseth halseth left a comment

Choose a reason for hiding this comment

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

LGTM!

@cfromknecht cfromknecht force-pushed the router-prevent-rescan branch from e27a4e0 to 97baf70 Compare November 11, 2017 22:38
Roasbeef
Roasbeef previously approved these changes Nov 11, 2017
Copy link
Member

@Roasbeef Roasbeef left a comment

Choose a reason for hiding this comment

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

LGTM ⛄️

 This commit alters the behavior of the router's logic on
 startup, ensuring that the chain view is filtered using
 the router's latest prune height. Before, the chain was
 filtered using the bestHeight variable, which was
 uninitialized, benignly forcing a rescan from genesis.
 In tracking down this, we realized that we should
 actually be using the prune height, as this is
 representative of the channel view loaded from disk.
 The best height/hash are now only used during
 startup to determine if we are out of sync.
@cfromknecht cfromknecht force-pushed the router-prevent-rescan branch from 97baf70 to e62bb03 Compare November 11, 2017 23:53
@Roasbeef Roasbeef merged commit 06f8247 into lightningnetwork:master Nov 12, 2017
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.

3 participants