Commit b94d0c7
committed
Merge bitcoin#23201: wallet: Allow users to specify input weights when funding a transaction
3866272 tests: Test specifying input weights (Andrew Chow)
6fa762a rpc, wallet: Allow users to specify input weights (Andrew Chow)
808068e wallet: Allow user specified input size to override (Andrew Chow)
4060c50 wallet: add input weights to CCoinControl (Andrew Chow)
Pull request description:
When funding a transaction with external inputs, instead of providing solving data, a user may want to just provide the maximum signed size of that input. This is particularly useful in cases where the input is nonstandard as our dummy signer is unable to handle those inputs.
The input weight can be provided to any input regardless of whether it belongs to the wallet and the provided weight will always be used regardless of any calculated input weight. This allows the user to override the calculated input weight which may overestimate in some circumstances due to missing information (e.g. if the private key is not known, a maximum size signature will be used, but the actual signer may be doing additional work which reduces the size of the signature).
For `send` and `walletcreatefundedpsbt`, the input weight is specified in a `weight` field in an input object. For `fundrawtransaction`, a new `input_weights` field is added to the `options` object. This is an array of objects consisting of a txid, vout, and weight.
Closes bitcoin#23187
ACKs for top commit:
instagibbs:
reACK bitcoin@3866272
glozow:
reACK 3866272 via range-diff
t-bast:
ACK bitcoin@3866272
Tree-SHA512: 2c8b471ee537c62a51389b7c4e86b5ac1c3a223b444195042be8117b3c83e29c0619463610b950cbbd1648d3ed01ecc5bb0b3c4f39640680da9157763b9b9f9fFile tree
9 files changed
+376
-18
lines changed- src/wallet
- rpc
- test
- test/functional
9 files changed
+376
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
118 | 135 | | |
119 | 136 | | |
120 | 137 | | |
| 138 | + | |
| 139 | + | |
121 | 140 | | |
122 | 141 | | |
123 | 142 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
429 | 430 | | |
430 | 431 | | |
431 | 432 | | |
| 433 | + | |
432 | 434 | | |
433 | 435 | | |
434 | 436 | | |
| |||
548 | 550 | | |
549 | 551 | | |
550 | 552 | | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
551 | 584 | | |
552 | 585 | | |
553 | 586 | | |
| |||
585 | 618 | | |
586 | 619 | | |
587 | 620 | | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
588 | 638 | | |
589 | 639 | | |
590 | 640 | | |
| |||
626 | 676 | | |
627 | 677 | | |
628 | 678 | | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
629 | 690 | | |
630 | 691 | | |
631 | 692 | | |
| |||
1007 | 1068 | | |
1008 | 1069 | | |
1009 | 1070 | | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
1010 | 1076 | | |
1011 | 1077 | | |
1012 | 1078 | | |
| |||
1110 | 1176 | | |
1111 | 1177 | | |
1112 | 1178 | | |
| 1179 | + | |
1113 | 1180 | | |
1114 | 1181 | | |
1115 | 1182 | | |
| |||
1250 | 1317 | | |
1251 | 1318 | | |
1252 | 1319 | | |
| 1320 | + | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
1253 | 1325 | | |
1254 | 1326 | | |
1255 | 1327 | | |
| |||
1330 | 1402 | | |
1331 | 1403 | | |
1332 | 1404 | | |
| 1405 | + | |
| 1406 | + | |
1333 | 1407 | | |
1334 | 1408 | | |
1335 | 1409 | | |
1336 | | - | |
| 1410 | + | |
1337 | 1411 | | |
1338 | 1412 | | |
1339 | 1413 | | |
| |||
1343 | 1417 | | |
1344 | 1418 | | |
1345 | 1419 | | |
1346 | | - | |
| 1420 | + | |
| 1421 | + | |
1347 | 1422 | | |
1348 | 1423 | | |
1349 | 1424 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
455 | 455 | | |
456 | 456 | | |
457 | 457 | | |
458 | | - | |
459 | | - | |
460 | | - | |
| 458 | + | |
| 459 | + | |
461 | 460 | | |
462 | | - | |
463 | 461 | | |
464 | 462 | | |
465 | 463 | | |
466 | 464 | | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
467 | 469 | | |
468 | 470 | | |
469 | 471 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
66 | 117 | | |
67 | 118 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1507 | 1507 | | |
1508 | 1508 | | |
1509 | 1509 | | |
| 1510 | + | |
| 1511 | + | |
| 1512 | + | |
| 1513 | + | |
| 1514 | + | |
| 1515 | + | |
| 1516 | + | |
| 1517 | + | |
| 1518 | + | |
| 1519 | + | |
| 1520 | + | |
| 1521 | + | |
| 1522 | + | |
| 1523 | + | |
| 1524 | + | |
| 1525 | + | |
| 1526 | + | |
| 1527 | + | |
| 1528 | + | |
| 1529 | + | |
| 1530 | + | |
| 1531 | + | |
| 1532 | + | |
| 1533 | + | |
| 1534 | + | |
| 1535 | + | |
| 1536 | + | |
| 1537 | + | |
| 1538 | + | |
| 1539 | + | |
| 1540 | + | |
| 1541 | + | |
| 1542 | + | |
| 1543 | + | |
| 1544 | + | |
| 1545 | + | |
| 1546 | + | |
| 1547 | + | |
| 1548 | + | |
| 1549 | + | |
| 1550 | + | |
| 1551 | + | |
| 1552 | + | |
1510 | 1553 | | |
1511 | 1554 | | |
1512 | 1555 | | |
| |||
1515 | 1558 | | |
1516 | 1559 | | |
1517 | 1560 | | |
| 1561 | + | |
| 1562 | + | |
| 1563 | + | |
| 1564 | + | |
| 1565 | + | |
| 1566 | + | |
| 1567 | + | |
| 1568 | + | |
1518 | 1569 | | |
1519 | 1570 | | |
1520 | 1571 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
939 | 939 | | |
940 | 940 | | |
941 | 941 | | |
| 942 | + | |
| 943 | + | |
942 | 944 | | |
943 | 945 | | |
944 | 946 | | |
0 commit comments