mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-05 15:24:18 +01:00
funding tx: include segwit marker + flag in fee calculation
Noticed an off by one error when running tests for dual-funding; we're not including the two 'header' segwit bytes in our weight calculations.
This commit is contained in:
committed by
Rusty Russell
parent
b0b6ddb66f
commit
c7f3fa34b2
@@ -90,6 +90,8 @@ int main(int argc, char *argv[])
|
||||
|
||||
/* nVersion, input count, output count, nLocktime */
|
||||
weight = 4 * (4 + 1 + 1 + 4);
|
||||
/* Add segwit fields: marker + flag */
|
||||
weight += 1 + 1;
|
||||
/* Single output: Satoshis, script length, p2wsh. */
|
||||
weight += 4 * (8 + 1 + BITCOIN_SCRIPTPUBKEY_P2WSH_LEN);
|
||||
/* Single input: txid, index, scriptlen, nSequence */
|
||||
|
||||
Reference in New Issue
Block a user