Commit f0745d0
committed
Merge bitcoin#30050: refactor, wallet: get serialized size of
a9c7300 move-only: refactor CreateTransactionInternal (josibake)
adc6ab2 wallet: use CRecipient instead of CTxOut (josibake)
Pull request description:
Broken out from bitcoin#28201
---
In order to estimate fees properly, we need to know what the final serialized transaction size will be. This PR refactors `CreateTransactionInternal` to:
* Get the serialized size directly from the `CRecipient`: this sets us up in a future PR to calculate the serialized size of silent payment `CTxDestinations` (see bitcoin@797e21c)
* Use the new `GetSerializeSizeForRecipient` to move the serialize size calculation to *before* coin selection and the output creation to *after* coin selection: this also sets us up for silent payments sending in a future PR in that silent payments outputs cannot be created until after the inputs to the transaction have been selected
Aside from the silent payments use case, I think this structure logically makes more sense. As a reminder, move-only commits are best reviewed with something like `git diff -w --color-moved=dimmed-zebra`
ACKs for top commit:
S3RK:
reACK a9c7300
achow101:
ACK a9c7300
rkrux:
tACK [a9c7300](bitcoin@a9c7300)
Tree-SHA512: 412e1764b98f7428c8530c3a68f55e32063d6b66ab2ff613e1c7e12d49b049807cb60055cfe7f7e8ffe7ac7f0f9931427cbfd3efe7d4f97a5a0f6d1bf1aaac58CRecipients directly1 file changed
+23
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
983 | 983 | | |
984 | 984 | | |
985 | 985 | | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
986 | 996 | | |
987 | 997 | | |
988 | 998 | | |
| |||
1005 | 1015 | | |
1006 | 1016 | | |
1007 | 1017 | | |
| 1018 | + | |
| 1019 | + | |
1008 | 1020 | | |
1009 | 1021 | | |
1010 | 1022 | | |
1011 | 1023 | | |
1012 | 1024 | | |
1013 | 1025 | | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
1014 | 1032 | | |
1015 | 1033 | | |
1016 | 1034 | | |
| |||
1095 | 1113 | | |
1096 | 1114 | | |
1097 | 1115 | | |
1098 | | - | |
1099 | | - | |
1100 | | - | |
1101 | | - | |
1102 | | - | |
1103 | | - | |
1104 | | - | |
1105 | | - | |
1106 | | - | |
1107 | | - | |
1108 | | - | |
1109 | | - | |
1110 | | - | |
1111 | | - | |
1112 | | - | |
1113 | | - | |
1114 | | - | |
1115 | 1116 | | |
1116 | 1117 | | |
1117 | 1118 | | |
| |||
1152 | 1153 | | |
1153 | 1154 | | |
1154 | 1155 | | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
1155 | 1161 | | |
1156 | 1162 | | |
1157 | 1163 | | |
| |||
0 commit comments