From 4fd7e26bf783dbd727ba2eb941310ad5aba510ae Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Mon, 5 Feb 2018 18:48:57 +0100 Subject: [PATCH] wallet: Re-introduce change assertion for withdrawals This was removed because withdraw-to-self results in more than the change being sent to us. Signed-off-by: Christian Decker --- wallet/walletrpc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/wallet/walletrpc.c b/wallet/walletrpc.c index 3e63afdd9..5f4ae86a7 100644 --- a/wallet/walletrpc.c +++ b/wallet/walletrpc.c @@ -61,6 +61,7 @@ static void wallet_withdrawal_broadcast(struct bitcoind *bitcoind, /* Note normally, change_satoshi == withdraw->changesatoshi, but * not if we're actually making a payment to ourselves! */ + assert(change_satoshi >= withdraw->changesatoshi); struct json_result *response = new_json_result(cmd); json_object_start(response, NULL);