Difference between revisions of "Split 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/c72ce59c-65c0-4a90-943a-c669bac5a737" width="300" height="1004" frameborder="...")
 
Line 3: Line 3:
 
This procedure is used when, either due to a large output or small inputs, the inputs required to satisfy a single output can not fit within transaction size limits.
 
This procedure is used when, either due to a large output or small inputs, the inputs required to satisfy a single output can not fit within transaction size limits.
  
The outBailment will be split across two or more transactions.
+
The <code>outBailment</code> will be split across two or more transactions.
  
 
==Initial Conditions==
 
==Initial Conditions==
Line 22: Line 22:
 
# Update the <code>status</code> field for this outBailmentID in the [[withdrawal status]] object to "partial-".
 
# Update the <code>status</code> field for this outBailmentID in the [[withdrawal status]] object to "partial-".
 
# 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)|10]]
+
[[Category:Transaction Construction Algorithm (voting pools)|12]]

Revision as of 14:40, 22 October 2014

This procedure is used when, either due to a large output or small inputs, the inputs required to satisfy a single output can not fit within transaction size limits.

The outBailment will be split across two or more transactions.

Initial Conditions

  • The transaction being constructed contains one change output, one non-change output, and many inputs.
  • The transaction did not exceed any size limits until the most recent input was added.

Sequence

  1. Remove the change output from the transaction.
  2. Decrement the value of the nextchangestart property of the withdrawal status object.
  3. Determine if the transaction still exceeds size limits.
    1. If yes, then remove the most-recently added input.
  4. Update the value of the output in the transaction to be the sum of the inputs minus the required transaction fee.
  5. Make a copy of the outputs object corresponding to this outBailmentID.
  6. Update the amount field of the copied output by subtracting the value determined in step 4.
  7. Push this new output to the output stack.
  8. Update the status field for this outBailmentID in the withdrawal status object to "partial-".
  9. Perform the Finalize Transaction Procedure.
  10. Initialize a new transaction.