We just sent the last entry in txs[]. Shrink and send the next last. */
| 131 | |
| 132 | /* We just sent the last entry in txs[]. Shrink and send the next last. */ |
| 133 | static void broadcast_remainder(struct bitcoind *bitcoind, |
| 134 | bool success, const char *msg, |
| 135 | struct txs_to_broadcast *txs) |
| 136 | { |
| 137 | if (!success) |
| 138 | log_debug(bitcoind->log, |
| 139 | "Expected error broadcasting tx %s: %s", |
| 140 | txs->txs[txs->cursor], msg); |
| 141 | |
| 142 | txs->cursor++; |
| 143 | if (txs->cursor == tal_count(txs->txs)) { |
| 144 | tal_free(txs); |
| 145 | return; |
| 146 | } |
| 147 | |
| 148 | /* Broadcast next one. */ |
| 149 | bitcoind_sendrawtx(bitcoind, |
| 150 | txs->cmd_id[txs->cursor], txs->txs[txs->cursor], |
| 151 | false, |
| 152 | broadcast_remainder, txs); |
| 153 | } |
| 154 | |
| 155 | /* FIXME: This is dumb. We can group txs and avoid bothering bitcoind |
| 156 | * if any one tx is in the main chain. */ |
no test coverage detected