Page MenuHomePhabricator

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

Authored by tobias_ruck on Thu, Aug 22, 02:51.

Details

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

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.Thu, Aug 22, 12:05