diff --git a/lightningd/peer_control.c b/lightningd/peer_control.c index 2de0b7c5a..024c61fe7 100644 --- a/lightningd/peer_control.c +++ b/lightningd/peer_control.c @@ -2559,6 +2559,11 @@ static void json_fund_channel(struct command *cmd, return; } + if (fc->funding_satoshi >= MAX_FUNDING_MSATOSHI) { + command_fail(cmd, "Funding msatoshi must be < %d", MAX_FUNDING_MSATOSHI); + return; + } + /* FIXME: Support push_msat? */ fc->push_msat = 0; diff --git a/lightningd/peer_control.h b/lightningd/peer_control.h index 31d8640b2..24c94f9ee 100644 --- a/lightningd/peer_control.h +++ b/lightningd/peer_control.h @@ -14,6 +14,7 @@ #include #define ANNOUNCE_MIN_DEPTH 6 +#define MAX_FUNDING_MSATOSHI (1 << 24) struct crypto_state;