Output List Initialization
Jump to navigation Jump to search
The startwithdrawal API call has been received by the wallet, and all the arguments have been checked for errors.
- Pass the
dustthresholdparameters to the input selection algorithm to obtain an ordered list of eligible inputs.
- Perform a first pass check to determine if the requested outputs exceed the size of the eligible inputs. Note that this check is only definitive in the case where the output sum is greater than the input sum. At this stage of the algorithm, the input sum exceeding the output sum does not prove that all outputs will be successfully created.
- Take the sum of both lists.
- If the sum of the outputs exceeds the sum of the inputs, remove outputs in descending size order until this is no longer true. Note this may result in the output list being an empty set.
- Removed outputs are given a status of "partial-" at this stage. This status will be updated at the end of the procedure to include the series number which must be made hot to satisfy the outBailment.
- If the output list is non-empty, sort it by
SHA256(server id, transaction number)where the server id and transaction number come from the outBailmentID.
- Express the server id and transaction number as strings, and concatenate them prior to hashing
- Move both the input lists and outputs lists into separate stacks by pushing them in reverse list order. The first input and first output should be on the top of their respective stacks.