get10101 / 10101

10101 (Ten-Ten-One): Self-custodial derivative trading at your fingertips.
https://10101.finance
MIT License
127 stars 23 forks source link

Own change output from funding tx is not shown in the balance #2286

Open holzeis opened 6 months ago

holzeis commented 6 months ago

Labeling this as bug as it used to behave differently before.

luckysori commented 5 months ago

@holzeis: Do you mean that the change output is missing when the transaction is still unconfirmed? I can reproduce that, but once the transaction is confirmed, the balance is updated correctly.

We should still include pending outputs in the wallet balance somehow.

holzeis commented 5 months ago

@holzeis: Do you mean that the change output is missing when the transaction is still unconfirmed?

Yes, we used to trust unconfirmed change output from our own transactions.

luckysori commented 5 months ago

I think this can be fixed by adding a get_change_address method to rust-dlc's Wallet trait.

At the moment, there is only a get_new_address method which is used for every situation. bdk can trust unconfirmed payments to change addresses, but not unconfirmed payments to external addresses.