MCPcopy Create free account
hub / github.com/ElementsProject/lightning / has_commitments_secured

Function has_commitments_secured

plugins/spender/multifundchannel.c:96–122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

94}
95
96static bool
97has_commitments_secured(const struct multifundchannel_destination *dest)
98{
99 /* If it failed, make sure we hadn't gotten
100 * commitments yet */
101 enum multifundchannel_state state = dest->state;
102 if (state == MULTIFUNDCHANNEL_FAILED)
103 state = dest->fail_state;
104
105 switch (state) {
106 case MULTIFUNDCHANNEL_START_NOT_YET:
107 case MULTIFUNDCHANNEL_CONNECTED:
108 case MULTIFUNDCHANNEL_STARTED:
109 case MULTIFUNDCHANNEL_UPDATED:
110 return false;
111 case MULTIFUNDCHANNEL_COMPLETED:
112 case MULTIFUNDCHANNEL_SECURED:
113 case MULTIFUNDCHANNEL_SIGNED_NOT_SECURED:
114 case MULTIFUNDCHANNEL_SIGNED:
115 case MULTIFUNDCHANNEL_DONE:
116 return true;
117 case MULTIFUNDCHANNEL_FAILED:
118 /* Shouldn't be FAILED */
119 break;
120 }
121 abort();
122}
123
124/*-----------------------------------------------------------------------------
125Command Cleanup

Callers 1

Calls 1

abortFunction · 0.85

Tested by

no test coverage detected