Open elnosh opened 1 year ago
When sending from wallet, the way outputs are constructed in the request for /split they could be telling the mint which is the intended payment amount vs which is the change.
/split
Code in wallet constructing output
total := SumProofs(proofs) frstAmt := total - amount scndAmt := amount frstOutputs := mint.AmountSplit(frstAmt) scndOutputs := mint.AmountSplit(scndAmt) amounts := append(frstOutputs, scndOutputs...)
So if user has a balance of 100 and tries a send 20 the output amounts when requesting a split to the mint could look like [16, 64, 4, 16]
send 20
[16, 64, 4, 16]
Describe the solution you'd like Maybe sort the outputs slice before sending request to mint.
When sending from wallet, the way outputs are constructed in the request for
/split
they could be telling the mint which is the intended payment amount vs which is the change.Code in wallet constructing output
So if user has a balance of 100 and tries a
send 20
the output amounts when requesting a split to the mint could look like[16, 64, 4, 16]
Describe the solution you'd like Maybe sort the outputs slice before sending request to mint.