HomePhabricator

[ecash-lib] Fix fee estimation for signatories that depend on tx outputs

Description

[ecash-lib] Fix fee estimation for signatories that depend on tx outputs

Summary:
Currently the TxBuilder estimates the required fee for transactions that have a Signatory that depends on the outputs incorrectly; after splicing out the leftover output, it should run the signatories again so they can update the input scripts again, such that we get a correct fee estimation.

Otherwise the sign function would throw an error despite actually having enough satoshis for the tx.

Worst case this runs the Signatories 3 times (once for initial estimation with leftover, another time to run again to check for sufficient input value after removing the leftover, and the last time to actually sign the signatures), however, having the correct behavior is more important, and also since we use EccDummy, signatories will run cheaply (just a few byte ops).

Test Plan: npm run integration-tests

Reviewers: #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

Differential Revision: https://reviews.bitcoinabc.org/D16673

Details

Provenance
tobias_ruckAuthored on Thu, Aug 22, 02:50
tobias_ruckPushed on Thu, Aug 22, 12:27
Reviewer
Restricted Project
Differential Revision
D16673: [ecash-lib] Fix fee estimation for signatories that depend on tx outputs
Parents
rABC9e12b2825253: [explorer] Remove extra pagination
Branches
Unknown
Tags
Unknown