Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Marina shows incorrect balance when using custom script accounts #372

Open
altafan opened this issue Jul 29, 2022 · 6 comments
Open

Marina shows incorrect balance when using custom script accounts #372

altafan opened this issue Jul 29, 2022 · 6 comments

Comments

@altafan
Copy link
Collaborator

altafan commented Jul 29, 2022

If i send LBTC funds from the marina main account to a customscript one, then the balance in the homepage is wrong.
The balance of the view should show the one of the main account, but instead it shows the balance of every accounts, in fact instead of considering the spent funds as outcoming, i see them as incoming funds (for the customscript one).

To make a parallel with the marina provider, it seems like it is showing the balance coming from marina.getBalances() instead of the one returned by marina.getBalances([marinaMainAccountID]).

@altafan altafan added the bug Something isn't working label Jul 29, 2022
@tiero
Copy link
Member

tiero commented Jul 29, 2022

Acutally the balances should show all utxos from all account mixed, that arr "auto-spendabale"

the spent funds as outcoming, i see them as incoming funds

This seems the actual bug instead. Are you sure you are mistaking the change as the outcoming funds?

@tiero
Copy link
Member

tiero commented Jul 29, 2022

Actually the balances should show all utxos from all account mixed, that are "auto-spendabale"

the spent funds as outcoming, I see them as incoming funds

This seems the actual bug instead. Are you sure you are mistaking the change for the outcoming funds?

@altafan
Copy link
Collaborator Author

altafan commented Jul 30, 2022

This seems the actual bug instead. Are you sure you are mistaking the change as the outcoming funds?

Well, not sure it is a bug... the funds that are shown as incoming rather than outcoming are those deposited to the contract address of the customscript account. It's not a bug because they are outcoming for the main account, but incoming for the custom one since the funds have been moved across 2 accounts basically.

Acutally the balances should show all utxos from all account mixed, that arr "auto-spendabale"

Oh, I supposed it was showing only those of the main account since the UI basically lets to interact only with that account.

Showing the balances of all accounts might be ok, but then leads to the kind of "confusion" described just above in case of cross-account transactions.

@altafan altafan removed the bug Something isn't working label Jul 30, 2022
@tiero
Copy link
Member

tiero commented Jul 30, 2022

UI basically lets to interact only with that account.

The UI (and marina.sendTransaction) let you interact with ALL accounts, as long the utxos are "auto-spenadable"

have been moved across 2 accounts basically.

regardless of which account is, the utxo if NOT auto-spendable shound NOT be shown in UI, and not picked up by coinselction via UI or marina.sendTransaction

Last time I tried, what I saw as "incoming" was the L-BTC change (confidential), I never seen the locked coveanant amount, so worth make a test again, can't replicate. (to be clear change should NOT be shown as incoming either, but I see why now it's happening with mutli-asset custom tx due curren heuristics)

@tiero
Copy link
Member

tiero commented Jul 31, 2022

on approach could be that we ALWYAS assume that incoming payment to change addresses MUST not be shown.

But could happens someone is giving out the change address as an incoming address and we do not show that in the incoming payment?

ie. all those +9.. in the following screenshot are my change outputs

image

@louisinger
Copy link
Collaborator

related to #374

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants