Browse Source

jsonrpc: Return an error if funding amount is too large

Fixes #516

Reported-by: @instagibbs
Signed-off-by: Christian Decker <decker.christian@gmail.com>
ppa-0.6.1
Christian Decker 7 years ago
parent
commit
351718e90f
  1. 5
      lightningd/peer_control.c
  2. 1
      lightningd/peer_control.h

5
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;

1
lightningd/peer_control.h

@ -14,6 +14,7 @@
#include <wire/peer_wire.h>
#define ANNOUNCE_MIN_DEPTH 6
#define MAX_FUNDING_MSATOSHI (1 << 24)
struct crypto_state;

Loading…
Cancel
Save