elements: Add elements overhead to sweep transactions

Turns out we weren't yet.
This commit is contained in:
Christian Decker 2019-09-23 19:09:59 +02:00 committed by Rusty Russell
parent 37fb912524
commit 81abf14142
1 changed files with 1 additions and 0 deletions

View File

@ -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