Fix overflow bug in analyzepsbt fee: CAmount instead of int #15582
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
Reviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
@sipa Very nice find. Thanks for fixing.
How did you find this issue? Did you find this by manual or tool assisted analysis?
I had this issue in my back log of conversion warnings to investigate manually but you beat me to it :-)
FWIW, these are all the related
… int c9963ae Fix overflow bug in analyzepsbt fee: CAmount instead of int (Pieter Wuille) Pull request description: This causes the `fee` and `estimated_feerate` values in the the analyzepsbt output to be off if the amount being spent exceed 21.47483647 BTC. Tree-SHA512: 61c1e26894617c51cc5fc026a3677a0b759fcbac1e70efa7fdc68d57cfd484525e18c906f1b8c06fd5d846b74a3cb4bc0bbd302a6eeaade79055a47d6d0dacc2
@sipa Are you willing to share how this bug was found? I think it would be valuable to do an informal short "post mortem" of this kind of issues.
That would allow us to reason about which mistakes that are recurring and could be candidates for identification by intelligent use of tooling.