Git Product home page Git Product logo

Comments (7)

chappjc avatar chappjc commented on July 29, 2024 1

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.

norwnd avatar norwnd commented on July 29, 2024

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.

chappjc avatar chappjc commented on July 29, 2024
  • 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.

alexlyp avatar alexlyp commented on July 29, 2024

I have a rough idea of how it could happen, I'll have to try it out on testnet myself.

from decrediton.

norwnd avatar norwnd commented on July 29, 2024

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:

image

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):

image

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.

chappjc avatar chappjc commented on July 29, 2024

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.

norwnd avatar norwnd commented on July 29, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.