mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-04 14:54:26 +01:00
funding: don't allow funding new channels until we're synced.
This is probably worth preventing. 1. Our depth estimate would be inaccurate possibly leading to us timing out too early. 2. If we're not up-to-date our onchain funds are unknown. 3. We wouldn't be able to send or receive HTLCs until we're synced anyway. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
c3a35416da
commit
ca28c30eff
@@ -1273,6 +1273,11 @@ static struct command_result *json_fund_channel_start(struct command *cmd,
|
||||
"Feerate below feerate floor");
|
||||
}
|
||||
|
||||
if (!topology_synced(cmd->ld->topology)) {
|
||||
return command_fail(cmd, FUNDING_STILL_SYNCING_BITCOIN,
|
||||
"Still syncing with bitcoin network");
|
||||
}
|
||||
|
||||
peer = peer_by_id(cmd->ld, id);
|
||||
if (!peer) {
|
||||
return command_fail(cmd, LIGHTNINGD, "Unknown peer");
|
||||
@@ -1365,6 +1370,11 @@ static struct command_result *json_fund_channel(struct command *cmd,
|
||||
"Feerate below feerate floor");
|
||||
}
|
||||
|
||||
if (!topology_synced(cmd->ld->topology)) {
|
||||
return command_fail(cmd, FUNDING_STILL_SYNCING_BITCOIN,
|
||||
"Still syncing with bitcoin network");
|
||||
}
|
||||
|
||||
peer = peer_by_id(cmd->ld, id);
|
||||
if (!peer) {
|
||||
return command_fail(cmd, LIGHTNINGD, "Unknown peer");
|
||||
|
||||
Reference in New Issue
Block a user