wizardsardine / liana

The missing safety net for your coins
https://wizardsardine.com/liana
BSD 3-Clause "New" or "Revised" License
314 stars 56 forks source link

Change should not be shown as unconfirmed with Liana Connect #1375

Open nondiremanuel opened 1 week ago

nondiremanuel commented 1 week ago

During the testing phase of v7, we realized that using Liana Connect as backend, when sending a tx that doesn't spend the whole coin, the change is shown in the home screen as "Unconfirmed" until the tx is mined. This is not the expected behavior for change, since it should be considered already confirmed.

A first analysis was already performed. Quoting from the discussion we had:

GUI does not use the specific endpoint /refresh of the backend, because it uses the common interface with the daemon which is the generate_spend. So the change address is just added to the recipients. The fix: change the payload to pstbs/generate to include a field change_address, that takes the derivation index and the address generated by the gui.

pythcoiner commented 1 week ago

Looking into this, a send-to-self (multipath 0) output is also shown as unconfirmed (w/ a bitcoind/liana_connect backend, not tested on electrum), but should not if we follow the same idea i guess

pythcoiner commented 1 week ago

Note: anyway only confirmed coins are added to the confirmed balance

pythcoiner commented 1 week ago

sparrow behaviour when sending to self: image

nondiremanuel commented 1 week ago

Looking into this, a send-to-self (multipath 0) output is also shown as unconfirmed (w/ a bitcoind/liana_connect backend, not tested on electrum), but should not if we follow the same idea i guess

Yes, I too believe the send to self should be consistent with the change management.

nondiremanuel commented 1 week ago

sparrow behaviour when sending to self: image

* Balance is updated

* Fee amount is unconfirmed unconfirmed

Electrum has the same behavior. It seems reasonable to me, we could replicate it.

nondiremanuel commented 1 week ago

Update after offline chat: let's keep this issue focused on the change management. We will tackle how to show the balance of self-transfers separately (see: https://github.com/wizardsardine/liana/issues/1378#issuecomment-2413350570)