272 implemented shuffling of outputs in transactions, with no consideration for the type of the output.
The previous implementation before that used a deterministic sorting based on the output amount and script, which by shear luck resulted in OP_RETURN outputs always being the first output because it has a zero amount.
This PR restores this behavior of putting the OP_RETURN always first, and adds a way to keep the other outputs sorted when using OP_RETURN. This is needed for crafting SLP transactions (see https://www.youtube.com/watch?v=TU1LBd9aVlc)
272 implemented shuffling of outputs in transactions, with no consideration for the type of the output.
The previous implementation before that used a deterministic sorting based on the output amount and script, which by shear luck resulted in OP_RETURN outputs always being the first output because it has a zero amount.
This PR restores this behavior of putting the OP_RETURN always first, and adds a way to keep the other outputs sorted when using OP_RETURN. This is needed for crafting SLP transactions (see https://www.youtube.com/watch?v=TU1LBd9aVlc)