Commit d6edd15
committed
wallet: skip APS when no partial spend exists
APS runs a second coin selection to fully spend UTXOs sharing a
scriptPubKey. Currently runs unconditionally, even when the first
selection has no partial spend and APS cannot help.
Detect partial spends by comparing selected vs available UTXO counts
per scriptPubKey inside CreateTransactionInternal, reusing available_coins.
Add has_partial_spend to CreatedTransactionResult. Skip APS if false.
Update interface_usdt_coinselection test to expect APS to be skipped
when no partial spend exists. Add new test that creates a partial spend
scenario so the full APS tracepoint flow is verified.
Fixes #251501 parent 5f66fca commit d6edd15
File tree
3 files changed
+62
-15
lines changed- src/wallet
- test/functional
3 files changed
+62
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1211 | 1211 | | |
1212 | 1212 | | |
1213 | 1213 | | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
| 1218 | + | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
1214 | 1236 | | |
1215 | 1237 | | |
1216 | 1238 | | |
| |||
1404 | 1426 | | |
1405 | 1427 | | |
1406 | 1428 | | |
1407 | | - | |
| 1429 | + | |
1408 | 1430 | | |
1409 | 1431 | | |
1410 | 1432 | | |
| |||
1432 | 1454 | | |
1433 | 1455 | | |
1434 | 1456 | | |
1435 | | - | |
| 1457 | + | |
1436 | 1458 | | |
| 1459 | + | |
| 1460 | + | |
| 1461 | + | |
1437 | 1462 | | |
1438 | 1463 | | |
1439 | 1464 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
208 | 208 | | |
209 | 209 | | |
210 | 210 | | |
| 211 | + | |
| 212 | + | |
211 | 213 | | |
212 | | - | |
213 | | - | |
| 214 | + | |
| 215 | + | |
214 | 216 | | |
215 | 217 | | |
216 | 218 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | | ||
120 | 120 | | |
121 | 121 | | |
122 | | - | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
123 | 125 | | |
124 | 126 | | |
125 | 127 | | |
126 | 128 | | |
127 | | - | |
| 129 | + | |
128 | 130 | | |
129 | 131 | | |
130 | 132 | | |
| |||
180 | 182 | | |
181 | 183 | | |
182 | 184 | | |
183 | | - | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
184 | 206 | | |
185 | 207 | | |
186 | 208 | | |
187 | 209 | | |
188 | 210 | | |
189 | 211 | | |
190 | | - | |
191 | | - | |
| 212 | + | |
| 213 | + | |
192 | 214 | | |
193 | 215 | | |
194 | 216 | | |
| |||
212 | 234 | | |
213 | 235 | | |
214 | 236 | | |
215 | | - | |
216 | | - | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
217 | 240 | | |
218 | 241 | | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | 242 | | |
223 | | - | |
| 243 | + | |
224 | 244 | | |
225 | 245 | | |
226 | 246 | | |
| |||
0 commit comments