| 94 | } |
| 95 | |
| 96 | static bool |
| 97 | has_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 | /*----------------------------------------------------------------------------- |
| 125 | Command Cleanup |
no test coverage detected