smite-ir: add RecvShutdown operation - #163
Conversation
753acf6 to
b44be37
Compare
NishantBansal2003
left a comment
There was a problem hiding this comment.
I think this needs to be rebased on top of #162 to consume the affine type SentShutdown
morehouse
left a comment
There was a problem hiding this comment.
I think we want the affine type wired in for sure.
But that probably isn't enough -- we can't expect the target to send us a shutdown message until all HTLCs have been resolved as well. There's also probably a case where we could send two shutdown messages and the target may ignore any of them after the first one.
I think for the HTLCs we can't really implement that part until #111 is implemented, so we can just add a TODO for that.
For the duplicate shutdown case we could probably add a flag to the channel state that indicates whether the peer has already responded to the first shutdown, and if they have then any subsequent RecvShutdown message becomes a no-op (similar to RecvChannelReady).
b44be37 to
7c5f9fc
Compare
bc867ba to
77cf4f8
Compare
Added TODOs in 77cf4f8. I thought it would be useful to group all HTLC TODOs together with
We now check in 77cf4f8 if we expect a shutdown on any channel. Only then we wait for a shutdown response. We don't know on which channel we will receive a shutdown, but I could change TODO:
Mhh, I wonder if there's a conflict between this (#163 (comment)):
and this (#163 (review)):
In 77cf4f8, |
c9a2c60 to
2a50e89
Compare
This implements the
RecvShutdownoperation for #98.TODO:
shutdownhas standard shutdown script (#186)shutdownmatches channel id we'd expectupfront_shutdown_scriptSentShutdown(ChannelId)and checkpeer_shutdown_receivedfor that channel inis_shutdown_expectedupfront_shutdown_scriptinAcceptChannelOracleShutdownOracle