Initialize New Transaction
- There are no pending transactions in the process of being constructed, either because this is the first transaction of the algorithm or because a previous pending transaction has been moved to the finished transaction list.
- Create a minimal transaction skeleton with a header and no inputs or outputs.
- We expect the transaction to have one change output, but it can not be added yet since it should appear last.
- The change output must be included in the skeleton for transaction size calculations.
After creating the transaction skeleton, and after any action which alters it, the new transaction size (bytes) and minimum required transaction fee must be recalculated.
Size checking is performed by creating a copy of the transaction, adding a dummy change output, and verifying that the transaction fits within all applicable limits.