mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 05:12:45 +01:00
Remove unused function json_dev_broadcast(...)
This commit is contained in:
parent
3e7d98a52d
commit
f15868a94d
@ -181,11 +181,6 @@ static void rebroadcast_txs(struct chain_topology *topo, struct command *cmd)
|
|||||||
struct txs_to_broadcast *txs;
|
struct txs_to_broadcast *txs;
|
||||||
struct outgoing_tx *otx;
|
struct outgoing_tx *otx;
|
||||||
|
|
||||||
#if DEVELOPER
|
|
||||||
if (topo->dev_no_broadcast)
|
|
||||||
return;
|
|
||||||
#endif /* DEVELOPER */
|
|
||||||
|
|
||||||
txs = tal(topo, struct txs_to_broadcast);
|
txs = tal(topo, struct txs_to_broadcast);
|
||||||
txs->cmd = cmd;
|
txs->cmd = cmd;
|
||||||
|
|
||||||
@ -260,12 +255,6 @@ void broadcast_tx(struct chain_topology *topo,
|
|||||||
log_add(topo->log, " (tx %s)",
|
log_add(topo->log, " (tx %s)",
|
||||||
type_to_string(ltmp, struct bitcoin_txid, &otx->txid));
|
type_to_string(ltmp, struct bitcoin_txid, &otx->txid));
|
||||||
|
|
||||||
#if DEVELOPER
|
|
||||||
if (topo->dev_no_broadcast) {
|
|
||||||
broadcast_done(topo->bitcoind, 0, "dev_no_broadcast", otx);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
bitcoind_sendrawtx(topo->bitcoind, otx->hextx, broadcast_done, otx);
|
bitcoind_sendrawtx(topo->bitcoind, otx->hextx, broadcast_done, otx);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -554,35 +543,6 @@ struct txlocator *locate_tx(const void *ctx, const struct chain_topology *topo,
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if DEVELOPER
|
#if DEVELOPER
|
||||||
void json_dev_broadcast(struct command *cmd,
|
|
||||||
struct chain_topology *topo,
|
|
||||||
const char *buffer, const jsmntok_t *params)
|
|
||||||
{
|
|
||||||
jsmntok_t *enabletok;
|
|
||||||
bool enable;
|
|
||||||
|
|
||||||
if (!json_get_params(cmd, buffer, params,
|
|
||||||
"enable", &enabletok,
|
|
||||||
NULL)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!json_tok_bool(buffer, enabletok, &enable)) {
|
|
||||||
command_fail(cmd, "Enable must be true or false");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
log_debug(cmd->ld->log, "dev-broadcast: broadcast %s",
|
|
||||||
enable ? "enabled" : "disabled");
|
|
||||||
cmd->ld->topology->dev_no_broadcast = !enable;
|
|
||||||
|
|
||||||
/* If enabling, flush and wait. */
|
|
||||||
if (enable)
|
|
||||||
rebroadcast_txs(cmd->ld->topology, cmd);
|
|
||||||
else
|
|
||||||
command_success(cmd, null_response(cmd));
|
|
||||||
}
|
|
||||||
|
|
||||||
static void json_dev_blockheight(struct command *cmd,
|
static void json_dev_blockheight(struct command *cmd,
|
||||||
const char *buffer UNUSED, const jsmntok_t *params UNUSED)
|
const char *buffer UNUSED, const jsmntok_t *params UNUSED)
|
||||||
{
|
{
|
||||||
@ -706,9 +666,6 @@ struct chain_topology *new_topology(struct lightningd *ld, struct log *log)
|
|||||||
topo->default_fee_rate = 40000;
|
topo->default_fee_rate = 40000;
|
||||||
topo->override_fee_rate = NULL;
|
topo->override_fee_rate = NULL;
|
||||||
topo->bitcoind = new_bitcoind(topo, ld, log);
|
topo->bitcoind = new_bitcoind(topo, ld, log);
|
||||||
#if DEVELOPER
|
|
||||||
topo->dev_no_broadcast = false;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return topo;
|
return topo;
|
||||||
}
|
}
|
||||||
|
@ -113,11 +113,6 @@ struct chain_topology {
|
|||||||
/* Transactions/txos we are watching. */
|
/* Transactions/txos we are watching. */
|
||||||
struct txwatch_hash txwatches;
|
struct txwatch_hash txwatches;
|
||||||
struct txowatch_hash txowatches;
|
struct txowatch_hash txowatches;
|
||||||
|
|
||||||
#if DEVELOPER
|
|
||||||
/* Suppress broadcast (for testing) */
|
|
||||||
bool dev_no_broadcast;
|
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Information relevant to locating a TX in a blockchain. */
|
/* Information relevant to locating a TX in a blockchain. */
|
||||||
@ -163,10 +158,6 @@ void notify_new_block(struct lightningd *ld, unsigned int height);
|
|||||||
void notify_feerate_change(struct lightningd *ld);
|
void notify_feerate_change(struct lightningd *ld);
|
||||||
|
|
||||||
#if DEVELOPER
|
#if DEVELOPER
|
||||||
void json_dev_broadcast(struct command *cmd,
|
|
||||||
struct chain_topology *topo,
|
|
||||||
const char *buffer, const jsmntok_t *params);
|
|
||||||
|
|
||||||
void chaintopology_mark_pointers_used(struct htable *memtable,
|
void chaintopology_mark_pointers_used(struct htable *memtable,
|
||||||
const struct chain_topology *topo);
|
const struct chain_topology *topo);
|
||||||
#endif
|
#endif
|
||||||
|
@ -300,8 +300,6 @@ static void dev_register_opts(struct lightningd *ld)
|
|||||||
opt_register_noarg("--dev-no-reconnect", opt_set_bool,
|
opt_register_noarg("--dev-no-reconnect", opt_set_bool,
|
||||||
&ld->no_reconnect,
|
&ld->no_reconnect,
|
||||||
"Disable automatic reconnect attempts");
|
"Disable automatic reconnect attempts");
|
||||||
opt_register_noarg("--dev-no-broadcast", opt_set_bool,
|
|
||||||
&ld->topology->dev_no_broadcast, opt_hidden);
|
|
||||||
opt_register_noarg("--dev-fail-on-subdaemon-fail", opt_set_bool,
|
opt_register_noarg("--dev-fail-on-subdaemon-fail", opt_set_bool,
|
||||||
&ld->dev_subdaemon_fail, opt_hidden);
|
&ld->dev_subdaemon_fail, opt_hidden);
|
||||||
opt_register_arg("--dev-debugger=<subdaemon>", opt_subd_debug, NULL,
|
opt_register_arg("--dev-debugger=<subdaemon>", opt_subd_debug, NULL,
|
||||||
|
Loading…
Reference in New Issue
Block a user