From c22d7012a3cccc23b6ccf70c3d8d4d1a014e158d Mon Sep 17 00:00:00 2001 From: Simon Vrouwe Date: Thu, 11 Oct 2018 09:41:48 +0300 Subject: [PATCH] lightningd: fail fundchannel command when feerate is below feerate_floor --- lightningd/opening_control.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lightningd/opening_control.c b/lightningd/opening_control.c index 433d4a3cf..c008eb9ef 100644 --- a/lightningd/opening_control.c +++ b/lightningd/opening_control.c @@ -1,3 +1,4 @@ +#include "bitcoin/feerate.h" #include #include #include @@ -791,6 +792,11 @@ static void json_fund_channel(struct command *cmd, } } + if (*feerate_per_kw < feerate_floor()) { + command_fail(cmd, LIGHTNINGD, "Feerate below feerate floor"); + return; + } + peer = peer_by_id(cmd->ld, id); if (!peer) { command_fail(cmd, LIGHTNINGD, "Unknown peer");