Comments (7)
Maybe messaging for this could be improved in Decrediton itself: when Decrediton wallet is started and there are open orders on Decrediton-embedded-DEX it could prompt the user to login directly transferring him onto DEX login page, any reason for not to do so ?
Broadly speaking, Decrediton has no clue what DEX is doing, except indirectly by observing the affects on dcrwallet, which include balance and locked UTXO changes. For Decrediton to figure out if there are active orders, it presently requires logging into DEX (and updating the core adapter with a method to get the exchange map with orders, the easy part). We can probably make some changes to client/core.Core
to make this info available to consumers like Decrediton prior to logging in. We can look at that after decred/dcrdex#1903
from decrediton.
I've tried to reproduce this issue and stumbled upon 2nd type of it, I think. Basically,
- sometimes I get the
Insufficient funds
error like I've described above - other times I'm actually able to send transaction successfully (it got mined) while still having my DEX order booked (meaning, it will fail if counter party tries to accept it because I no longer have enough DCR since I just sent somewhere else)
Also, I think DEX devs have fixed some issues related to locking/unlocking funds recently (or maybe still working them out), so that could contribute to what I'm observing here as well.
from decrediton.
- other times I'm actually able to send transaction successfully (it got mined) while still having my DEX order booked (meaning, it will fail if counter party tries to accept it because I no longer have enough DCR since I just sent somewhere else)
It should not have spent the locked UTXOs in this case. Have you verified that this transaction you sent from Decrediton spent the coins that were reserved by a DEX order?
Also, I think DEX devs have fixed some issues related to locking/unlocking funds recently (or maybe still working them out), so that could contribute to what I'm observing here as well.
Everything is solid with UTXO coin locking/unlocking. I can't say what is possible for a Decrediton user to manually do to override it though (unlocking coins somehow?). When trades are running, the user shouldn't be spending funds from the used account from within Decrediton.
from decrediton.
I have a rough idea of how it could happen, I'll have to try it out on testnet myself.
from decrediton.
It should not have spent the locked UTXOs in this case. Have you verified that this transaction you sent from Decrediton spent the coins that were reserved by a DEX order?
I didn't check the exact coins used simply because I had: booked-order-value + sent-value > total balance in Decrediton,
I tried to reproduce it again just so we get the complete picture, so I create limit sell order on DEX with the following funding coins:
- https://testnet.dcrdata.org/tx/f6323249b74a2da19d6b5b61df817b1e1ed1f0637243be0b909d05b5e1858aca/out/1
- https://testnet.dcrdata.org/tx/e70f362975d3103d926fe66eaa2c9281f1b6c78df7cfafcb2ad7f30ddf47e292/out/0 (this is the one to pay attention to)
and then I when I don't see any funds being locked in Decrediton (I had/have same ~80 DCR in my Decrediton wallet, in mixed account, before and after my DEX order for selling 60 DCR is booked; with 0 DCR locked before/after order is booked):
then I close DEX window and try to send 60 DCR and I get Insufficient funds
error (like I mentioned above) - so I'm unable to spend funds locked in my DEX limit order, but I'm not informed about why I can't (because they are locked in DEX order),
then I close Decrediton app and open it again (basically restarting my Decrediton wallet), and while I can still see that 60 DCR sell-limit-order on DEX in "booked" status (I don't open DEX window, and I don't log in here - just looking at the DEX-server order-book from another separate browser-client to make sure the order is still there) I try to send 60 DCR and I now I succeed (maybe if I log in Insufficient funds
error will appear again ?), so the behavior changed from error to allowing me to spend funds locked in DEX order after restart spending those same outputs locked in my DEX order.
Note, in both cases (before and after restart) I'm trying to send to my own address (from that same Decrediton wallet), but that shouldn't matter I think ? Becase that funding coin got spent on-chain anyway.
Observing this with Decrediton:release-v1.7.6
testnet.
from decrediton.
then I close DEX window and try to send 60 DCR and I get
Insufficient funds
error (like I mentioned above) - so I'm unable to spend funds locked in my DEX limit order, but I'm not informed about why I can't (because they are locked in DEX order),
In the above case, this is all working as intended except for Decrediton messaging and locked balance display, as you say. Decrediton can be changed to check listunspent and listlockunspent (frequently) to discern the correct locked balance amount.
then I close Decrediton app and open it again (basically restarting my Decrediton wallet), and while I can still see that 60 DCR sell-limit-order on DEX in "booked" status (I don't open DEX window, and I don't log in here - just looking at the DEX-server order-book from another separate browser-client to make sure the order is still there). I try to send 60 DCR and I now I succeed
Well that was an important detail. Yeah, when you restart dcrwallet (that Decrediton restart does), the locked coins are unlocked. Only when you log back into DEX will it re-lock the coins. I think there's ample messaging not to do this, and if you do, to log back in immediately or orders may fail.
from decrediton.
In the above case, this is all working as intended except for Decrediton messaging and locked balance display, as you say. Decrediton can be changed to check listunspent and listlockunspent (frequently) to discern the correct locked balance amount.
Yeah, messaging is what I think could be improved there.
Only when you log back into DEX will it re-lock the coins. I think there's ample messaging not to do this, and if you do, to log back in immediately or orders may fail.
Maybe messaging for this could be improved in Decrediton itself: when Decrediton wallet is started and there are open orders on Decrediton-embedded-DEX it could prompt the user to login directly transferring him onto DEX login page, any reason for not to do so ?
from decrediton.
Related Issues (20)
- Add hardware wallet button on main screen HOT 6
- setting voting preference: already voted error HOT 3
- Minor button text misalignment on Mixer Settings
- "Wallet Reset Required" to enable DEX -> "Wallet Restart Required"
- multi: Add Ledger support. HOT 7
- Capitalize Decrediton
- Placeholder text in wallet launcher
- High Contrast Greyscale Themes HOT 1
- cannot remove SPV Connect setting HOT 4
- Load Custom Translation is missing on macOS
- Decrediton 1.8.0: No feedback when purchasing ticket with wrong password HOT 2
- Failed to retrieve user information: response buffer too short HOT 1
- Trezor fixes (bundle bridge + udev rules) HOT 2
- Decrediton 1.8.0 doesn't send HOT 3
- Receive into unmixed (not default) by default, when in mixing mode
- Consider getting rid of "private" in "private passphrase" HOT 1
- Trezor: Webpack build broken on master. HOT 1
- Ledger: Broken on master. HOT 5
- Wallet splash page tutorial "Block Creation" still has placeholder text HOT 1
- UX Idea: Show status of Ticket Purchase? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from decrediton.