diff options
author | Ava Chow <github@achow101.com> | 2024-06-27 13:59:46 -0400 |
---|---|---|
committer | Ava Chow <github@achow101.com> | 2024-06-27 13:59:46 -0400 |
commit | f0745d028e42486fb346015cfc481923739c479e (patch) | |
tree | 5a51bee47a72b386b7edb7c24dcd2b95f814405b /src/node/caches.cpp | |
parent | b27afb7fb774809c9c075d56e44657e0b607a00c (diff) | |
parent | a9c7300135f0188daa5bce5491e2daf2dd8da8ae (diff) |
Merge bitcoin/bitcoin#30050: refactor, wallet: get serialized size of `CRecipient`s directly
a9c7300135f0188daa5bce5491e2daf2dd8da8ae move-only: refactor CreateTransactionInternal (josibake)
adc6ab25bba42ce9e7ed6bd7599aabb6dead6987 wallet: use CRecipient instead of CTxOut (josibake)
Pull request description:
Broken out from #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 https://github.com/bitcoin/bitcoin/pull/28201/commits/797e21c8c1bf393e668eeef8bb7ee9cae1e5e41e)
* 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 a9c7300135f0188daa5bce5491e2daf2dd8da8ae
achow101:
ACK a9c7300135f0188daa5bce5491e2daf2dd8da8ae
rkrux:
tACK [a9c7300](https://github.com/bitcoin/bitcoin/pull/30050/commits/a9c7300135f0188daa5bce5491e2daf2dd8da8ae)
Tree-SHA512: 412e1764b98f7428c8530c3a68f55e32063d6b66ab2ff613e1c7e12d49b049807cb60055cfe7f7e8ffe7ac7f0f9931427cbfd3efe7d4f97a5a0f6d1bf1aaac58
Diffstat (limited to 'src/node/caches.cpp')
0 files changed, 0 insertions, 0 deletions