Page MenuHomePhabricator

Merge #10712: Add change output if necessary to reduce excess fee

Authored by jasonbcox on Feb 8 2019, 23:47.



0f402b9 Fix rare edge case of paying too many fees when transaction has no change. (Alex Morcos)
253cd7e Only reserve key for scriptChange once in CreateTransaction (Alex Morcos)

Pull request description:

This is an alternative to #10333

See commit messages.

The first commit is mostly code move, it just moves the change creation code out of the loop.


Tree-SHA512: f16287ae0f0c6f09cf8b1f0db5880bb567ffa74a50898e3d1ef549ba592c6309ae1a9b251739f63a8bb622d48f03ce2dff9e7a57a6bac4afb4b95b0a86613ea8

Backport of Core PR10712
Completes T534

Applied after this fix: D2522
Since this patch was originally reverted due to a test failure: D2517

Test Plan
make check rpc_fundrawtransaction

Diff Detail

rABC Bitcoin ABC
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

jasonbcox created this revision.Feb 8 2019, 23:47
Herald added a reviewer: Restricted Project. · View Herald TranscriptFeb 8 2019, 23:47
Herald added a subscriber: schancel. · View Herald Transcript
deadalnix accepted this revision.Feb 9 2019, 20:07
This revision is now accepted and ready to land.Feb 9 2019, 20:07
This revision was automatically updated to reflect the committed changes.