Unspent output ordering within createrawtransaction

+4 votes

When using createrawtransaction, are the unspent outputs ordered as they are presented within the request?

So if I have a sample set of outputs like below:

{
    "{{address-1}}":{"TOKEN-1":1},
    "{{address-2}}":{"issue":{"raw":100}}
}

Can I always assume the output for the token-1 is [0] and the new asset issuance is output [1] , and that the asset details which would be appended in a follow-on transaction using appendrawdata would be output [2]?

 

Thx

Marty

asked Aug 22, 2017 by marty

1 Answer

0 votes

Yes, the outputs are added in the same order as they are provided in the API request, and the metadata outputs (which you can also now specify in createrawtransaction itself) will come after the outputs which go to specific addresses.

answered Aug 22, 2017 by MultiChain
Great...thx.  Missed the change the createrawtransaction to build it all in one call.....

Cheers

Marty
...