mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-22 00:24:19 +01:00
Handle anchor in a run of blocks.
Fix dff50c3a5f: if multiple blocks come between
polling, we'll get called once for the new tip.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -2961,7 +2961,8 @@ static enum watch_result anchor_depthchange(struct peer *peer,
|
|||||||
{
|
{
|
||||||
/* Still waiting for it to reach depth? */
|
/* Still waiting for it to reach depth? */
|
||||||
if (state_is_waiting_for_anchor(peer->state)) {
|
if (state_is_waiting_for_anchor(peer->state)) {
|
||||||
if ((int)depth == peer->anchor.ok_depth) {
|
/* We can see a run of blocks all at once, so may be > depth */
|
||||||
|
if ((int)depth >= peer->anchor.ok_depth) {
|
||||||
state_event(peer, BITCOIN_ANCHOR_DEPTHOK, NULL);
|
state_event(peer, BITCOIN_ANCHOR_DEPTHOK, NULL);
|
||||||
peer->anchor.ok_depth = -1;
|
peer->anchor.ok_depth = -1;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user