A state machine.



Summary:

In this context, Pierre explains the sequence of states that Bob goes through during a transaction. Initially, Bob is in the NORMAL state and receives an update_add_htlc from Alice. He sends an update_accept to Alice and switches to the WAIT_FOR_UPDATE_SIG state when he receives an update_signature from Alice. At this stage, Bob sends an update_complete to Alice and switches back to the NORMAL state.When Carol completes a htlc, Bob sees CMD_SEND_HTLC_COMPLETE and follows the process of switching between various states, including NORMAL, STATE_WAIT_FOR_HTLC_ACCEPT, STATE_WAIT_FOR_UPDATE_COMPLETE, and back to NORMAL.Bob then sends an update_add_htlc to Carol on another channel and receives an update_complete_htlc from Carol on another channel. He sends an update_complete_htlc to Alice and switches to the WAIT_FOR_HTLC_ACCEPT state when he receives an update_accept from Alice. Bob then sends an update_signature to Alice and switches to the WAIT_FOR_UPDATE_COMPLETE state when he receives an update_complete from Alice. Finally, Bob switches back to the NORMAL state.Overall, this sequence of events may seem complex but it is a standard process for transactions involving multiple parties and channels. The text flowchart generated by Rusty helps to simplify the process and make it easier to understand.


Updated on: 2023-05-23T19:47:38.080318+00:00