Skip to content

Commit f15868a

Browse files
practicalswiftrustyrussell
authored andcommitted
Remove unused function json_dev_broadcast(...)
1 parent 3e7d98a commit f15868a

File tree

3 files changed

+0
-54
lines changed

3 files changed

+0
-54
lines changed

lightningd/chaintopology.c

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -181,11 +181,6 @@ static void rebroadcast_txs(struct chain_topology *topo, struct command *cmd)
181181
struct txs_to_broadcast *txs;
182182
struct outgoing_tx *otx;
183183

184-
#if DEVELOPER
185-
if (topo->dev_no_broadcast)
186-
return;
187-
#endif /* DEVELOPER */
188-
189184
txs = tal(topo, struct txs_to_broadcast);
190185
txs->cmd = cmd;
191186

@@ -260,12 +255,6 @@ void broadcast_tx(struct chain_topology *topo,
260255
log_add(topo->log, " (tx %s)",
261256
type_to_string(ltmp, struct bitcoin_txid, &otx->txid));
262257

263-
#if DEVELOPER
264-
if (topo->dev_no_broadcast) {
265-
broadcast_done(topo->bitcoind, 0, "dev_no_broadcast", otx);
266-
return;
267-
}
268-
#endif
269258
bitcoind_sendrawtx(topo->bitcoind, otx->hextx, broadcast_done, otx);
270259
}
271260

@@ -554,35 +543,6 @@ struct txlocator *locate_tx(const void *ctx, const struct chain_topology *topo,
554543
}
555544

556545
#if DEVELOPER
557-
void json_dev_broadcast(struct command *cmd,
558-
struct chain_topology *topo,
559-
const char *buffer, const jsmntok_t *params)
560-
{
561-
jsmntok_t *enabletok;
562-
bool enable;
563-
564-
if (!json_get_params(cmd, buffer, params,
565-
"enable", &enabletok,
566-
NULL)) {
567-
return;
568-
}
569-
570-
if (!json_tok_bool(buffer, enabletok, &enable)) {
571-
command_fail(cmd, "Enable must be true or false");
572-
return;
573-
}
574-
575-
log_debug(cmd->ld->log, "dev-broadcast: broadcast %s",
576-
enable ? "enabled" : "disabled");
577-
cmd->ld->topology->dev_no_broadcast = !enable;
578-
579-
/* If enabling, flush and wait. */
580-
if (enable)
581-
rebroadcast_txs(cmd->ld->topology, cmd);
582-
else
583-
command_success(cmd, null_response(cmd));
584-
}
585-
586546
static void json_dev_blockheight(struct command *cmd,
587547
const char *buffer UNUSED, const jsmntok_t *params UNUSED)
588548
{
@@ -706,9 +666,6 @@ struct chain_topology *new_topology(struct lightningd *ld, struct log *log)
706666
topo->default_fee_rate = 40000;
707667
topo->override_fee_rate = NULL;
708668
topo->bitcoind = new_bitcoind(topo, ld, log);
709-
#if DEVELOPER
710-
topo->dev_no_broadcast = false;
711-
#endif
712669

713670
return topo;
714671
}

lightningd/chaintopology.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,6 @@ struct chain_topology {
113113
/* Transactions/txos we are watching. */
114114
struct txwatch_hash txwatches;
115115
struct txowatch_hash txowatches;
116-
117-
#if DEVELOPER
118-
/* Suppress broadcast (for testing) */
119-
bool dev_no_broadcast;
120-
#endif
121116
};
122117

123118
/* Information relevant to locating a TX in a blockchain. */
@@ -163,10 +158,6 @@ void notify_new_block(struct lightningd *ld, unsigned int height);
163158
void notify_feerate_change(struct lightningd *ld);
164159

165160
#if DEVELOPER
166-
void json_dev_broadcast(struct command *cmd,
167-
struct chain_topology *topo,
168-
const char *buffer, const jsmntok_t *params);
169-
170161
void chaintopology_mark_pointers_used(struct htable *memtable,
171162
const struct chain_topology *topo);
172163
#endif

lightningd/options.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,8 +300,6 @@ static void dev_register_opts(struct lightningd *ld)
300300
opt_register_noarg("--dev-no-reconnect", opt_set_bool,
301301
&ld->no_reconnect,
302302
"Disable automatic reconnect attempts");
303-
opt_register_noarg("--dev-no-broadcast", opt_set_bool,
304-
&ld->topology->dev_no_broadcast, opt_hidden);
305303
opt_register_noarg("--dev-fail-on-subdaemon-fail", opt_set_bool,
306304
&ld->dev_subdaemon_fail, opt_hidden);
307305
opt_register_arg("--dev-debugger=<subdaemon>", opt_subd_debug, NULL,

0 commit comments

Comments
 (0)