mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-20 15:44:21 +01:00
jsonrpc: Return an error if funding amount is too large
Fixes #516 Reported-by: @instagibbs Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
@@ -2559,6 +2559,11 @@ static void json_fund_channel(struct command *cmd,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (fc->funding_satoshi >= MAX_FUNDING_MSATOSHI) {
|
||||||
|
command_fail(cmd, "Funding msatoshi must be < %d", MAX_FUNDING_MSATOSHI);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* FIXME: Support push_msat? */
|
/* FIXME: Support push_msat? */
|
||||||
fc->push_msat = 0;
|
fc->push_msat = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
#include <wire/peer_wire.h>
|
#include <wire/peer_wire.h>
|
||||||
|
|
||||||
#define ANNOUNCE_MIN_DEPTH 6
|
#define ANNOUNCE_MIN_DEPTH 6
|
||||||
|
#define MAX_FUNDING_MSATOSHI (1 << 24)
|
||||||
|
|
||||||
struct crypto_state;
|
struct crypto_state;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user