From 8c6fab0ec4c6bad12364e0ceebacb0ba8b45730b Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Thu, 22 Jun 2017 15:19:20 +0200 Subject: [PATCH] wallet: Do not create dust from withdrawal transactions --- wallet/walletrpc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wallet/walletrpc.c b/wallet/walletrpc.c index baea6636e..e7e4dd219 100644 --- a/wallet/walletrpc.c +++ b/wallet/walletrpc.c @@ -206,6 +206,10 @@ static void json_withdraw(struct command *cmd, return; } + /* FIXME(cdecker) Pull this from the daemon config */ + if (withdraw->changesatoshi <= 546) + withdraw->changesatoshi = 0; + withdraw->change_key_index = db_get_intvar(ld->wallet->db, "bip32_max_index", 0) + 1; db_set_intvar(ld->wallet->db, "bip32_max_index",