| 532 | } |
| 533 | |
| 534 | static size_t psbt_input_weight(struct wally_psbt *psbt, |
| 535 | size_t in) |
| 536 | { |
| 537 | size_t weight; |
| 538 | |
| 539 | /* txid + txout + sequence */ |
| 540 | weight = (32 + 4 + 4) * 4; |
| 541 | weight += |
| 542 | (psbt->inputs[in].redeem_script_len + |
| 543 | (varint_t) varint_size(psbt->inputs[in].redeem_script_len)) * 4; |
| 544 | |
| 545 | /* BOLT-f53ca2301232db780843e894f55d95d512f297f9 #3: |
| 546 | * |
| 547 | * The minimum witness weight for an input is 110. |
| 548 | */ |
| 549 | weight += 110; |
| 550 | return weight; |
| 551 | } |
| 552 | |
| 553 | static size_t psbt_output_weight(struct wally_psbt *psbt, |
| 554 | size_t outnum) |
no test coverage detected