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

Function broadcast_remainder

lightningd/chaintopology.c:133–153  ·  view source on GitHub ↗

We just sent the last entry in txs[]. Shrink and send the next last. */

Source from the content-addressed store, hash-verified

131
132/* We just sent the last entry in txs[]. Shrink and send the next last. */
133static 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. */

Callers 1

rebroadcast_txsFunction · 0.85

Calls 1

tal_freeFunction · 0.85

Tested by

no test coverage detected