Rollback Last Output
This procedure is used if a transaction has exceeded the size limit, and can be brought back under the limit by removing the most-recently added output and the inputs needed to support it from the transaction
The removed inputs and outputs will be added to the beginning of a new transaction.
This procedure will remove one more input than is required to bring the transaction below size limits, and then add exactly one more. This will always result in a valid transaction because the only way to reach this procedure is by having successfully completed at least one Add Next Output cycle for the current transaction prior to adding an output or input that pushes the transaction over the size limit.
- An oversize transaction contains one or more outputs and their supporting inputs which do not exceed transaction size limits, and one output which does not.
- The number of inputs which are solely dedicated to satisfying the most recently-added output (not required for previous outputs) may be zero or more.
- Remove the most-recently added output from the transaction and return it to the output stack.
- This will cause the output to be the first one added to the next transaction.
- Remove the most-recently added input from the transaction and return it to the input stack.
- If the sum of input values exceeds the sum of output values by an amount greater than the required transaction fee:
- Continue removing inputs one at a time until the sum of the input values falls below the needed output + transaction fee value.
- Add the next input from the stack to the transaction.
- Perform the Finalize Transaction procedure.
- Initialize a new transaction.