| 1171 | } |
| 1172 | |
| 1173 | static struct command_result *batch_one_complete(struct command *cmd, |
| 1174 | struct request_batch *batch) |
| 1175 | { |
| 1176 | void *arg; |
| 1177 | struct command_result *(*finalcb)(struct command *, void *); |
| 1178 | |
| 1179 | assert(batch->num_remaining); |
| 1180 | |
| 1181 | if (--batch->num_remaining != 0) |
| 1182 | return command_still_pending(cmd); |
| 1183 | |
| 1184 | arg = batch->arg; |
| 1185 | finalcb = batch->finalcb; |
| 1186 | tal_free(batch); |
| 1187 | return finalcb(cmd, arg); |
| 1188 | } |
| 1189 | |
| 1190 | static struct command_result *batch_one_success(struct command *cmd, |
| 1191 | const char *method, |
no test coverage detected