onchaind: Adjust witness weight estimate to be more conservative

We were missing the OP_PUSH for the pubkeys, and the spec mentions we
should be using 73 bytes to estimate the witness weight. Effectively
this adds 4 bytes which really just matters in case fees hit the
floor, and computing the weight becomes important.

Changelog-Fixed: onchaind: Witness weight estimations could be slightly lower than the VLS signer
This commit is contained in:
Christian Decker
2022-10-19 16:26:46 +02:00
parent 5cbd5220d9
commit 832b2e5e2e
4 changed files with 30 additions and 18 deletions

View File

@@ -427,7 +427,7 @@ def basic_fee(feerate):
def closing_fee(feerate, num_outputs):
assert num_outputs == 1 or num_outputs == 2
weight = 424 + 124 * num_outputs
weight = 428 + 124 * num_outputs
return (weight * feerate) // 1000