Difference between revisions of "Split Output"

From Open Transactions
Jump to navigation Jump to search
Line 7: Line 7:
 
==Initial Conditions==
 
==Initial Conditions==
  
* The transaction being constructed contains one change output, one non-change output, and many inputs.
+
* The transaction being constructed contains one output, and many inputs.
 
* The transaction did not exceed any size limits until the most recent input was added.
 
* The transaction did not exceed any size limits until the most recent input was added.
  
 
==Sequence==
 
==Sequence==
  
# Remove the change output from the transaction.
+
# Remove the most-recently added input.
# Decrement the value of the <code>nextchangestart</code> property of the [[withdrawal status]] object.
 
# Determine if the transaction still exceeds size limits.
 
## If yes, then remove the most-recently added input.
 
 
# Update the value of the output in the transaction to be the sum of the inputs minus the required transaction fee.
 
# Update the value of the output in the transaction to be the sum of the inputs minus the required transaction fee.
 
# Make a copy of the [[Outputs (Voting Pool Wallet API)|outputs]] object corresponding to this outBailmentID.
 
# Make a copy of the [[Outputs (Voting Pool Wallet API)|outputs]] object corresponding to this outBailmentID.

Revision as of 11:14, 4 November 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 output, and many inputs.
  • The transaction did not exceed any size limits until the most recent input was added.

Sequence

  1. Remove the most-recently added input.
  2. Update the value of the output in the transaction to be the sum of the inputs minus the required transaction fee.
  3. Make a copy of the outputs object corresponding to this outBailmentID.
  4. Update the amount field of the copied output by subtracting the value determined in step 4.
  5. Push this new output to the output stack.
  6. Update the status field for this outBailmentID in the withdrawal status object to "partial-".
  7. Perform the Finalize Transaction Procedure.
  8. Initialize a new transaction.