-
Notifications
You must be signed in to change notification settings - Fork 668
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement transaction weight prediction
When creating a transaction one must know the the fee beforehand to set appropriate amounts for outputs and to know the fee, weight is required. So far we only had a method on an already-constructed transaction. This method clearly wasn't helpful when constructing the transaction except for hacks like temporarily adding an all-zeroes signature. This change adds a function that can compute the transaction weight without knowing individual bytes of the scripts, witnesses and other elements. It only needs to know their sizes. To make the API less error-prone a special, trivial, type is also added for computing the lengths of witnesses.
- Loading branch information
Showing
1 changed file
with
125 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters