elements
elements copied to clipboard
Getting duplicated address error when sending different assets to the same address in the same transaction
Hello,
I believe we should be able to send different assets to the same address at once in the same transaction, but I get this error: Invalid parameter, duplicated address when I try to do it.
It happens when I do a createrawtransaction, so I think around this line:
https://github.com/ElementsProject/elements/blob/87028135adf4bc2beb160cab00a404a33f6c36ac/src/rpc/rawtransaction_util.cpp#L344
We should also look for what asset is being evaluated. Instead of looking of duplication of address, we should look for duplication of the tuple asset + address.
What do you think?
The test is not done there: https://github.com/ElementsProject/elements/blob/87028135adf4bc2beb160cab00a404a33f6c36ac/src/wallet/rpcwallet.cpp#L433 and there too: https://github.com/ElementsProject/elements/blob/87028135adf4bc2beb160cab00a404a33f6c36ac/src/wallet/rpcwallet.cpp#L3124
Cheers.
I wouldn't mind adding this support if there's a use case for it, but
- Address reuse is address reuse, even if you change assets, and we don't want to encourage this
- The entire
*rawtransactionworkflow is soft-deprecated in favor of PSET. Can you use PSET for this instead?
The entire *rawtransaction workflow is soft-deprecated in favor of PSET. Can you use PSET for this instead?
I see. Sure, I will give it a try.
Cheers