revaultd
revaultd copied to clipboard
Handle user sending to CPFP/deposit addresses at spend creation
If the user decides to send funds to the same address as the change, we should merge the two outputs
Example:
Vault is 10 BTC
User wants to send 2 BTC to *change_address*
We currently create the tx like:
Inputs:
10 BTC
Outputs:
2 BTC to *change address*
0.xxxx BTC to *cpfp address*
7.xxxx BTC to *change address*
We should do instead:
Inputs:
10 BTC
Outputs:
0.xxxx BTC to *cpfp address*
9.xxxx BTC to *change address*
What should we do if the user decides to send funds to a CPFP address?
We can either restrict it or merge the output with the CPFP output
What should we do if the user decides to send funds to a CPFP address?
I think we should for now duplicate it, since the CPFP output value computation is a trick it could be a sneaky source of bugs to try to be smart for now.