IMMEDIATELY AFTER RECEIVING CHANNEL_REESTABLISH
- Do we have any active inflight splices?
- Yes:
- does latest splice inflight have commit and remote sig?
- Yes: continue
- No: send next_funding txid of latest inflight candidate, then, continue
- peer sends next_funding value of:
- None: Have I sent splice tx signatures?
- Yes: Have I received splice tx signatures?
- Yes: send nothing
- No: unilaterally close
- No: Delete inflight (send nothing)
- Yes: Have I received splice tx signatures?
- Same as our next_funding: resume splice negotiation (send commit and splice sig)
- Same as our channel txid: error; unilaterally close
- Any other value: error; unilaterally close
- None: Have I sent splice tx signatures?
- does latest splice inflight have commit and remote sig?
- No: do not send any next_funding txid
- peer sends next_funding value of:
- Same as our channel txid
- resend splice_locked at the completion of reestablish
- Any other value
- Ignore, do not resume splice (we have nothing inflight to resume)
- Same as our channel txid
- peer sends next_funding value of:
- Yes:
I reviewed lightning/bolts@36c04c8 further and I think we can do it this way. My implementation was structured around "what are the conditions we should resume the splice" and this spec is more piecemeal in what is sent and leaves uncertainty on what is received. Had to do some restructuring but this works. So, happy to do it this way and be consistent with dual-funding.
The thing we do need to add is the resending of
splice_lockedwhen you receivenext_funding_txidthat matches your currentchannel_txid.