From 81abf14142bf2c36775303f066a0523cb6f75957 Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Mon, 23 Sep 2019 19:09:59 +0200 Subject: [PATCH] elements: Add elements overhead to sweep transactions Turns out we weren't yet. --- onchaind/onchaind.c | 1 + 1 file changed, 1 insertion(+) diff --git a/onchaind/onchaind.c b/onchaind/onchaind.c index c33c598ef..e24f584fd 100644 --- a/onchaind/onchaind.c +++ b/onchaind/onchaind.c @@ -332,6 +332,7 @@ static struct bitcoin_tx *tx_to_us(const tal_t *ctx, /* Worst-case sig is 73 bytes */ weight = bitcoin_tx_weight(tx) + 1 + 3 + 73 + 0 + tal_count(wscript); + weight = elements_add_overhead(weight, 1, 1); fee = amount_tx_fee(feerate_per_kw, weight); /* Result is trivial? Spend with small feerate, but don't wait