Difference between revisions of "Rollback Last Output"

From Open Transactions
Jump to navigation Jump to search
(Created page with "<div style="float: right"><include iframe src="https://www.lucidchart.com/documents/embeddedchart/81fbb6f6-b150-4a06-915e-7633b05da9af" width="300" height="600" frameborder="0...")
 
 
Line 21: Line 21:
 
# Add the next input from the stack to the transaction.
 
# Add the next input from the stack to the transaction.
 
# Perform the [[Finalize Transaction]] procedure.
 
# Perform the [[Finalize Transaction]] procedure.
# [[Initialize Transaction|Initialize]] a new transaction.
+
# [[Initialize New Transaction|Initialize]] a new transaction.
  
[[Category:Transaction Construction Algorithm (voting pools)|09]]
+
[[Category:Transaction Construction Algorithm (voting pools)|11]]

Latest revision as of 14:41, 22 October 2014

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.

Initial Conditions

  • 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.

Sequence

  1. 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.
  2. Remove the most-recently added input from the transaction and return it to the input stack.
  3. 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.
  4. Add the next input from the stack to the transaction.
  5. Perform the Finalize Transaction procedure.
  6. Initialize a new transaction.