I reply to all queries on the forums and via email, once per day, Monday to Friday (not weekends).

If you are new here, please see some information on how to ask for support. Thank you!

Coin Transaction Failed but ..

dashed-slug.net Forums TurtleCoin Adapter extension support Coin Transaction Failed but ..

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #10109
    LeinAd
    Participant

    …it sends three times? I sow a problem with withdrawing coins. User does a withdraw and confirm the mail. after a while in admin panel the transaction went from pending to failed but in the wallet this transaction arrives three times

    #10112
    LeinAd
    Participant

    after stetting Max retries for failed withdrawals to “1” it comes on transaction to the seperate wallet but it is shown as failed. i can set the hash in “wp_wallets_txs” by hand and set it to status: done .. then it is fine in the user account. This is for only one coin (this where i have a lot of problems with)

    #10113
    LeinAd
    Participant

    Last error message: Failed to perform withdrawal due to: phpcurl could not communicate with NimboCoin wallet. But transaction goes trought the chain

    #10121
    alexg
    Keymaster

    Hello,

    Please tell me the following:

    1. You mentioned that “This is for only one coin (this where i have a lot of problems with)”. Do you mean that you also use other coins based on turtlecoin that work fine, and only NimbusCoin has this issue? Or are your other coins based on another coin adapter?

    2. You mentioned that “transaction goes through the chain”. How did you determine this? Did you check using the wallet cli?

    3. If you increase the HTTP timeout for the coin adapter does this help with the withdrawals? You can specify the HTTP timeout for your adapter at Wallets -> (your turtlecoin adapter) -> “HTTP Adapter Settings” -> “HTTP request timeout (seconds)”

    4. In the withdrawal failure email, next to the message “Failed to perform withdrawal due to: phpcurl could not communicate with NimboCoin wallet.”, was there any error code or not?

    Thank you.

    with regards

    #10124
    LeinAd
    Participant

    hey Alex.
    1.) I have three other turtlecoin adapter and they are working fine
    2.) Yes i checked this in a wallet cli from outside.
    3.) For Nimbo i go up to 30seconds
    4.) no i found no error code only: Last error message: Failed to perform withdrawal due to: phpcurl could not communicate with NimboCoin wallet. Error 28: Operation timed out after 30004 milliseconds with 0 bytes received
    Transaction created at: 2021-02-28 14:43:22

    The Transaction come to cli-wallet at 2021-02-28 14:50

    #10132
    alexg
    Keymaster

    Hello,

    Thank you for your detailed response.

    The error code I asked for is 28 (curl timeout). This is the root cause of this issue, and also of the problems you report in this other thread. Here’s what happened:

    Currently the scalability of all the blockchains is being stress-tested due to the current market conditions. First Bitcoin, then Ethereum, and now it seems many cryptonote chains are also being affected. This is reflected mostly in network congestion and high fees.

    Recently someone had the same problem with Monero. The command that issues a transaction takes longer than 30 seconds to complete. Therefore, the curl call from the plugin to the wallet never gets back the TXID.

    I am guessing that this is due to network congestion. Another possibility is that, cryptonote transactions wait for more transactions to occur on the network, to do coinjoins and ensure anonymity. If there are too few transactions on the network, this may also be a reason why transaction execution is slow. The NimbusCoin developers should know more about this.

    Normally the plugin expects this situation:
    – A withdrawal is first marked as succeeded (done) on the DB.
    – Then the transaction is attempted on the wallet
    – Finally the plugin receives the result of the transaction. If successful, the TXID is updated on the DB. If the wallet responds with an error, the withdrawal is marked as failed.

    This is so as to ensure that, if the PHP thread running the withdrawals cron somehow crashes, the withdrawal is not re-attempted.

    However in this case, the adapter responds with an Exception, due to an HTTP timeout coming from curl. The plugin thinks that the wallet did not execute the transaction, and reattempts it. The wallet continues to reattempt the transaction, and this is how a double spend occurs.

    Several things need to be done here:

    – Since the wallet takes so long to place the transaction, you should increase the HTTP timeout beyond 30 seconds in the coin adapter settings. Go to Wallets -> Adapters -> (Your adapter) -> Settings -> HTTP adapter settings -> HTTP request timeout (seconds).
    – You should also increase the PHP execution timeout accordingly. How long the wallet needs to perform a transaction is beyond my control.
    – It’s a good idea to set the withdrawal attempts to 1 as extra safety. See Wallets -> Cron job -> Max retries for failed withdrawals.

    I will soon release a patch that will mitigate this risk. I am still evaluating the correct course of action, but basically, if there is a timeout, the plugin should assume that the transaction is succeeded, not failed. Better to err on the safe side! Then, in case of a timeout, the user balance will be updated correctly. The only problem will then be that the TXID will not be recorded in the DB, but this can be fixed.

    In any case, since the wallet takes longer than 30 seconds to place a transaction and respond with a TXID, you should let withdrawals run for 60 seconds, or however long it takes.

    I will contact you again here on this thread once I release the aforementioned patch.

    with regards

    #10137
    LeinAd
    Participant

    ok ty .. i set the http timeout very high for first ( HTTP request timeout > const uint64_t DIFFICULTY_TARGET_V2 = 180; ) and this works for first.

    TY Alex

    now i just have to find out which users have received double spends and correct it. Then all is fine

    #10143
    alexg
    Keymaster

    Hello,

    To find which DB withdrawals match to which transactions, you can look at the times and amounts. Hope it’s not too much work.

    I have not been able to develop the patch due to too much workload right now. It will be out before the end of the week, as this is kind of important!

    with regards

    #10148
    LeinAd
    Participant

    Only thing is negativ aviable amount when i correct the db .. i hope theres a solution for .. otherwise all is working fine..
    some suggestions for the UI but that can be later

    Sincerly

    #10156
    alexg
    Keymaster

    If the available balance is negative, but the user balance is positive or zero, then all is good.

    As mentioned above, simply cancel any pending outgoing transactions for that user. And also cancel any exchange orders for that user. The user can place these transactions again.

    I have now uploaded version 5.0.14 of Bitcoin and Altcoin Wallets and version 1.1.2 of the Monero coin adapter. With this patch, if a withdrawal fails due to a phpcurl timeout, the withdrawal is marked as done even if there is no available TXID. This will prevent any more double-spends.

    Again, my apologies for this issue with withdrawals. It is something that I could not have tested for, because the issue was caused partly by network conditions that were not present when I tested the adapter, and because I only tested on Monero and TurtleCoin. Since withdrawals were repeated, more funds have been sent to the user than they should. I sincerely hope that this did not result in loss of too many funds 🙁

    If you have a suggestion for the UI, please open a new thread about it. I no longer accept any feature requests/suggestions, only defects. But if it’s something easy I may be able to do it for the next version. And if not, then I can instruct you on how to edit the template files.

    with regards

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.