<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://opentransactions.org/wiki/index.php?action=history&amp;feed=atom&amp;title=Add_Next_Output</id>
	<title>Add Next Output - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://opentransactions.org/wiki/index.php?action=history&amp;feed=atom&amp;title=Add_Next_Output"/>
	<link rel="alternate" type="text/html" href="http://opentransactions.org/wiki/index.php?title=Add_Next_Output&amp;action=history"/>
	<updated>2026-06-13T07:27:39Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.32.2</generator>
	<entry>
		<id>http://opentransactions.org/wiki/index.php?title=Add_Next_Output&amp;diff=3107&amp;oldid=prev</id>
		<title>Justusranvier: /* Sequence */</title>
		<link rel="alternate" type="text/html" href="http://opentransactions.org/wiki/index.php?title=Add_Next_Output&amp;diff=3107&amp;oldid=prev"/>
		<updated>2014-11-04T11:01:58Z</updated>

		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Sequence&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 11:01, 4 November 2014&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l19&quot; &gt;Line 19:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 19:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;###* &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt;: next unused&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;###* &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt;: next unused&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;###* &amp;lt;code&amp;gt;amount&amp;lt;/code&amp;gt;: copied from [[Outputs (Voting Pool Wallet API)|outputs]] list.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;###* &amp;lt;code&amp;gt;amount&amp;lt;/code&amp;gt;: copied from [[Outputs (Voting Pool Wallet API)|outputs]] list.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Check that the transaction does not exceed size limits. If it does, follow the [[Oversize Transaction]] procedure.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Check that the transaction does not exceed &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;[[Initialize_New_Transaction#Size checking|&lt;/ins&gt;size limits&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;]]&lt;/ins&gt;. If it does, follow the [[Oversize Transaction]] procedure.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Compare the sum of the inputs to the sum of the outputs and required transaction fee to determine if more inputs are required.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Compare the sum of the inputs to the sum of the outputs and required transaction fee to determine if more inputs are required.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;## If no more inputs are required, then update the &amp;lt;code&amp;gt;status&amp;lt;/code&amp;gt; for this output to &amp;quot;success&amp;quot;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;## If no more inputs are required, then update the &amp;lt;code&amp;gt;status&amp;lt;/code&amp;gt; for this output to &amp;quot;success&amp;quot;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Justusranvier</name></author>
		
	</entry>
	<entry>
		<id>http://opentransactions.org/wiki/index.php?title=Add_Next_Output&amp;diff=3089&amp;oldid=prev</id>
		<title>Justusranvier: Created page with &quot;&lt;div style=&quot;float: right&quot;&gt;&lt;include iframe src=&quot;https://www.lucidchart.com/documents/embeddedchart/3e9b2758-338e-40f7-8fe2-e036fda68157&quot; width=&quot;600&quot; height=&quot;800&quot; frameborder=&quot;0...&quot;</title>
		<link rel="alternate" type="text/html" href="http://opentransactions.org/wiki/index.php?title=Add_Next_Output&amp;diff=3089&amp;oldid=prev"/>
		<updated>2014-10-22T14:28:56Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;div style=&amp;quot;float: right&amp;quot;&amp;gt;&amp;lt;include iframe src=&amp;quot;https://www.lucidchart.com/documents/embeddedchart/3e9b2758-338e-40f7-8fe2-e036fda68157&amp;quot; width=&amp;quot;600&amp;quot; height=&amp;quot;800&amp;quot; frameborder=&amp;quot;0...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;div style=&amp;quot;float: right&amp;quot;&amp;gt;&amp;lt;include iframe src=&amp;quot;https://www.lucidchart.com/documents/embeddedchart/3e9b2758-338e-40f7-8fe2-e036fda68157&amp;quot; width=&amp;quot;600&amp;quot; height=&amp;quot;800&amp;quot; frameborder=&amp;quot;0&amp;quot; scrolling=&amp;quot;yes&amp;quot; /&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Initial Conditions==&lt;br /&gt;
&lt;br /&gt;
The output stack contains at least one output.&lt;br /&gt;
&lt;br /&gt;
There is a transaction in progress which is ready to accept new outputs. This transaction is either empty or it contains 1 or more outputs.&lt;br /&gt;
&lt;br /&gt;
If the transaction already contains outputs, then it also contains sufficient inputs to cover those outputs and any required transaction fees without exceeding size limits. This is because it must have already successfully passed through this procedure before.&lt;br /&gt;
&lt;br /&gt;
==Sequence==&lt;br /&gt;
&lt;br /&gt;
# Locate the entry for this output in the [[Withdrawal status|withdrawal status]] object by finding the corresponding outBailmentID.&lt;br /&gt;
# Validate the output address.&lt;br /&gt;
## If it is invalid, update &amp;lt;code&amp;gt;status&amp;lt;/code&amp;gt; entry for this output to &amp;quot;invalid&amp;quot; and exit from this procedure.&lt;br /&gt;
## If it is valid, add it to the transaction.&lt;br /&gt;
### Add a new entry to the &amp;lt;code&amp;gt;transaction&amp;lt;/code&amp;gt; array for this output:&lt;br /&gt;
###* &amp;lt;code&amp;gt;ntxid&amp;lt;/code&amp;gt;: nil&lt;br /&gt;
###* &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt;: next unused&lt;br /&gt;
###* &amp;lt;code&amp;gt;amount&amp;lt;/code&amp;gt;: copied from [[Outputs (Voting Pool Wallet API)|outputs]] list.&lt;br /&gt;
# Check that the transaction does not exceed size limits. If it does, follow the [[Oversize Transaction]] procedure.&lt;br /&gt;
# Compare the sum of the inputs to the sum of the outputs and required transaction fee to determine if more inputs are required.&lt;br /&gt;
## If no more inputs are required, then update the &amp;lt;code&amp;gt;status&amp;lt;/code&amp;gt; for this output to &amp;quot;success&amp;quot;.&lt;br /&gt;
# If more inputs are required, then check to see if any more are available.&lt;br /&gt;
## According to the initial conditions, the input stack can not be empty on the first run through this loop.&lt;br /&gt;
## If the input stack is empty at this point, then the output has added at least one input beyond what was needed to satisfy the prior output (if there was a prior output)&lt;br /&gt;
## If the input stack is empty, then the output can only be partially fulfilled. Follow the [[Split Output]] procedure.&lt;br /&gt;
# Add the next input from the stack, and continue the loop at step 2.&lt;br /&gt;
&lt;br /&gt;
The loop will continue until either:&lt;br /&gt;
&lt;br /&gt;
* The transaction contains sufficient input value to satisfy the output plus transaction fees&lt;br /&gt;
* The transaction exceeds size limits&lt;br /&gt;
* There is not enough input value, but no more inputs are available&lt;br /&gt;
&lt;br /&gt;
[[Category:Transaction Construction Algorithm (voting pools)|04]]&lt;/div&gt;</summary>
		<author><name>Justusranvier</name></author>
		
	</entry>
</feed>