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

Function rebroadcast_txs

lightningd/chaintopology.c:157–180  ·  view source on GitHub ↗

FIXME: This is dumb. We can group txs and avoid bothering bitcoind * if any one tx is in the main chain. */

Source from the content-addressed store, hash-verified

155/* FIXME: This is dumb. We can group txs and avoid bothering bitcoind
156 * if any one tx is in the main chain. */
157static void rebroadcast_txs(struct chain_topology *topo)
158{
159 /* Copy txs now (peers may go away, and they own txs). */
160 struct txs_to_broadcast *txs;
161 struct outgoing_tx *otx;
162
163 txs = tal(topo, struct txs_to_broadcast);
164 txs->cmd_id = tal_arr(txs, const char *, 0);
165
166 /* Put any txs we want to broadcast in ->txs. */
167 txs->txs = tal_arr(txs, const char *, 0);
168 list_for_each(&topo->outgoing_txs, otx, list) {
169 if (wallet_transaction_height(topo->ld->wallet, &otx->txid))
170 continue;
171
172 tal_arr_expand(&txs->txs, tal_strdup(txs, otx->hextx));
173 tal_arr_expand(&txs->cmd_id,
174 otx->cmd_id ? tal_strdup(txs, otx->cmd_id) : NULL);
175 }
176
177 /* Let this do the dirty work. */
178 txs->cursor = (size_t)-1;
179 broadcast_remainder(topo->bitcoind, true, "", txs);
180}
181
182static void destroy_outgoing_tx(struct outgoing_tx *otx)
183{

Callers 1

updates_completeFunction · 0.85

Calls 2

broadcast_remainderFunction · 0.85

Tested by

no test coverage detected