Skip to content

funding_locked sent before channel_reestablish #4006

@TheBlueMatt

Description

@TheBlueMatt

This may be an old bug, I saw it while testing against the testnet.yalls.org node:

INFO  [lightning::ln::peer_handler : /home/matt/.cargo/git/checkouts/rust-lightning-61cf011b3b289b3b/7d6b98f/lightning/src/ln/peer_handler.rs, 629] Received peer Init message: data_loss_protect: supported, initial_routing_sync: not requested, upfront_shutdown_script: supported, unkown local flags: present, unknown global flags: present
...
TRACE [lightning::ln::peer_handler : /home/matt/.cargo/git/checkouts/rust-lightning-61cf011b3b289b3b/7d6b98f/lightning/src/ln/peer_handler.rs, 605] Received message of type 36 from 027455aef8453d92f4706b560b61527cc217ddf14da41770e8ed6607190a1851b8
TRACE [lightning::ln::channelmanager : /home/matt/.cargo/git/checkouts/rust-lightning-61cf011b3b289b3b/7d6b98f/lightning/src/ln/channelmanager.rs, 2225] Closing channel 51eb6695576cac1e3fb3a829b6b93e86f61d121dc59a5952da048138df33a34a due to Close-required error: Peer sent funding_locked when we needed a channel_reestablish
...
TRACE [lightning::ln::peer_handler : /home/matt/.cargo/git/checkouts/rust-lightning-61cf011b3b289b3b/7d6b98f/lightning/src/ln/peer_handler.rs, 605] Received message of type 136 from 027455aef8453d92f4706b560b61527cc217ddf14da41770e8ed6607190a1851b8

While the spec doesn't call it out explicitly, its somewhat nonsensical to send the funding_locked before the channel_reestablish:

if next_commitment_number is 1 in both the channel_reestablish it sent and received:
    MUST retransmit funding_locked.
otherwise:
    MUST NOT retransmit funding_locked.

as the first text there refers to the channel_reestablish in the past tense, and, really, why would you send a message about a channel before reestablishing the channel.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1MUST be fixed or reviewedspec

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions