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

failed swap can't be refunded #2136

Open
cipig opened this issue Jun 6, 2024 · 0 comments
Open

failed swap can't be refunded #2136

cipig opened this issue Jun 6, 2024 · 0 comments

Comments

@cipig
Copy link
Member

cipig commented Jun 6, 2024

user started a swap which failed like this:

{
   "error_events" : [
      "StartFailed",
      "NegotiateFailed",
      "TakerFeeSendFailed",
      "MakerPaymentValidateFailed",
      "MakerPaymentWaitConfirmFailed",
      "TakerPaymentTransactionFailed",
      "TakerPaymentWaitConfirmFailed",
      "TakerPaymentDataSendFailed",
      "TakerPaymentWaitForSpendFailed",
      "MakerPaymentSpendFailed",
      "TakerPaymentWaitRefundStarted",
      "TakerPaymentRefundStarted",
      "TakerPaymentRefunded",
      "TakerPaymentRefundedByWatcher",
      "TakerPaymentRefundFailed",
      "TakerPaymentRefundFinished"
   ],
   "events" : [
      {
         "event" : {
            "data" : {
               "fee_to_send_taker_fee" : {
                  "amount" : "0.00001",
                  "coin" : "VRSC",
                  "paid_from_trading_vol" : false
               },
               "lock_duration" : 7800,
               "maker" : "6da2fc632afabbb1b86d04a9a012db25eca74db38ba2eccd88552f27f4c0b245",
               "maker_amount" : "0.6980960426276235296132151382143358058125187635655887731217178346458047624255132846296255650275651326",
               "maker_coin" : "LTC",
               "maker_coin_htlc_pubkey" : "028a38bafdd6c1aa3ec34c480d6ae9383bee54eef7c115e51a5aeab699734ff055",
               "maker_coin_start_block" : 2697769,
               "maker_payment_confirmations" : 2,
               "maker_payment_requires_nota" : false,
               "maker_payment_spend_trade_fee" : {
                  "amount" : "0.00000716",
                  "coin" : "LTC",
                  "paid_from_trading_vol" : true
               },
               "maker_payment_wait" : 1717610301,
               "my_persistent_pub" : "028a38bafdd6c1aa3ec34c480d6ae9383bee54eef7c115e51a5aeab699734ff055",
               "p2p_privkey" : null,
               "started_at" : 1717607181,
               "taker_amount" : "57",
               "taker_coin" : "VRSC",
               "taker_coin_htlc_pubkey" : "028a38bafdd6c1aa3ec34c480d6ae9383bee54eef7c115e51a5aeab699734ff055",
               "taker_coin_start_block" : 3078295,
               "taker_payment_confirmations" : 5,
               "taker_payment_lock" : 1717614981,
               "taker_payment_requires_nota" : false,
               "taker_payment_trade_fee" : {
                  "amount" : "0.00001",
                  "coin" : "VRSC",
                  "paid_from_trading_vol" : false
               },
               "uuid" : "81709be1-d00f-497a-ad01-e06600668351"
            },
            "type" : "Started"
         },
         "timestamp" : 1717607181368
      },
      {
         "event" : {
            "data" : {
               "maker_coin_htlc_pubkey" : "026da2fc632afabbb1b86d04a9a012db25eca74db38ba2eccd88552f27f4c0b245",
               "maker_coin_swap_contract_addr" : null,
               "maker_payment_locktime" : 1717622780,
               "maker_pubkey" : "000000000000000000000000000000000000000000000000000000000000000000",
               "secret_hash" : "ec096d28ad636a53ac877d56363e6297b35fea49",
               "taker_coin_htlc_pubkey" : "026da2fc632afabbb1b86d04a9a012db25eca74db38ba2eccd88552f27f4c0b245",
               "taker_coin_swap_contract_addr" : null
            },
            "type" : "Negotiated"
         },
         "timestamp" : 1717607197443
      },
      {
         "event" : {
            "data" : {
               "tx_hash" : "0193432f7d74292a639191a1f2c10df8d4913c0194b3cbbc3c9e3d0a49003da3",
               "tx_hex" : "0400008085202f8901f6b1e88dbb786e48d77e4792d2a99f0cc79bbfdf06623d59cbe39c22aae1899e010000006b483045022100e8eb4caeeecf58455751b87ff06ce63af4c4e3ed502078c783cabb9228d5725f02206d3168fdd5f882113933cd19452a0f0ac32ec8b033f561b66f6e5b5f24d12b600121028a38bafdd6c1aa3ec34c480d6ae9383bee54eef7c115e51a5aeab699734ff055ffffffff02e3ef6f00000000001976a914ca1e04745e8ca0c60d8c5881531d51bec470743f88acba476cd30e0000001976a914d89058fbcce7402fb342dffadf04bd32dba29abe88ac1d9b6066000000000000000000000000000000"
            },
            "type" : "TakerFeeSent"
         },
         "timestamp" : 1717607197850
      },
      {
         "event" : {
            "data" : null,
            "type" : "TakerPaymentInstructionsReceived"
         },
         "timestamp" : 1717607198857
      },
      {
         "event" : {
            "data" : {
               "tx_hash" : "5771db2b6cfc3b8381ad0113882564e23a0cb1502f682725a749127aabdac328",
               "tx_hex" : "01000000000102409f4a07392ca3da7131277e9649a12292eb88b9ea4af05df6b55180729f89df0000000000ffffffff21447fbdc959f4b7c4a0a35a3dc4ccc1195108ee5fa5aa8bbccc835b482075860200000000ffffffff03c43529040000000017a9140972ccf6383b3416af02936a3bf3229b91a42956870000000000000000166a14ec096d28ad636a53ac877d56363e6297b35fea49de168e0000000000160014ed56f2feb905938b45d2e009ec14add0e7d0157202473044022053cc480403f9d2555bda58904b80b5ff10995e0344a25859e706d2ea80651a4e022001bafc2387b3d12e96b08f8fbba495185eab411878948b4b1f141f71e5aaa5be0121026da2fc632afabbb1b86d04a9a012db25eca74db38ba2eccd88552f27f4c0b2450247304402200db4fca44cfa40f1e45d2b1c0b281e6da375b3d196de6074eb091f94a83a9493022033b9a388167ba7bea148c79b4593b2fa77e6b7ebc7d2debab07f6e37c29ccc2e0121026da2fc632afabbb1b86d04a9a012db25eca74db38ba2eccd88552f27f4c0b2451e9b6066"
            },
            "type" : "MakerPaymentReceived"
         },
         "timestamp" : 1717607198860
      },
      {
         "event" : {
            "type" : "MakerPaymentWaitConfirmStarted"
         },
         "timestamp" : 1717607198862
      },
      {
         "event" : {
            "type" : "MakerPaymentValidatedAndConfirmed"
         },
         "timestamp" : 1717608841107
      },
      {
         "event" : {
            "data" : {
               "error" : "taker_swap:1488] Timeout 1717611160 > 1717610301"
            },
            "type" : "TakerPaymentTransactionFailed"
         },
         "timestamp" : 1717611160346
      },
      {
         "event" : {
            "type" : "Finished"
         },
         "timestamp" : 1717611160348
      }
   ],
   "gui" : "Komodo Wallet 0.9.1 iOS",
   "maker_amount" : "0.6980960426276235296132151382143358058125187635655887731217178346458047624255132846296255650275651326",
   "maker_coin" : "LTC",
   "maker_coin_usd_price" : "84.8",
   "mm_version" : "2.0.0-beta_b0fd99e",
   "my_order_uuid" : "81709be1-d00f-497a-ad01-e06600668351",
   "success_events" : [
      "Started",
      "Negotiated",
      "TakerFeeSent",
      "TakerPaymentInstructionsReceived",
      "MakerPaymentReceived",
      "MakerPaymentWaitConfirmStarted",
      "MakerPaymentValidatedAndConfirmed",
      "TakerPaymentSent",
      "WatcherMessageSent",
      "TakerPaymentSpent",
      "MakerPaymentSpent",
      "MakerPaymentSpentByWatcher",
      "Finished"
   ],
   "taker_amount" : "57",
   "taker_coin" : "VRSC",
   "taker_coin_usd_price" : "1.1",
   "type" : "Taker",
   "uuid" : "81709be1-d00f-497a-ad01-e06600668351"
}

mm2 says TakerPaymentTransactionFailed with timeout, but in reality, takerpayment went through and the funds now sit in the multisig: https://explorer.verus.io/address/bJ3YogrAuQB12hU8Su9Wv7K5wwjvRWE1NA but can't be refunded without manual editing of the json file...

interesting is that maker says the same (TakerPaymentValidateFailed) and refunded his makerpayment:

{
   "error_events" : [
      "StartFailed",
      "NegotiateFailed",
      "TakerFeeValidateFailed",
      "MakerPaymentTransactionFailed",
      "MakerPaymentDataSendFailed",
      "MakerPaymentWaitConfirmFailed",
      "TakerPaymentValidateFailed",
      "TakerPaymentWaitConfirmFailed",
      "TakerPaymentSpendFailed",
      "TakerPaymentSpendConfirmFailed",
      "MakerPaymentWaitRefundStarted",
      "MakerPaymentRefundStarted",
      "MakerPaymentRefunded",
      "MakerPaymentRefundFailed",
      "MakerPaymentRefundFinished"
   ],
   "events" : [
      {
         "event" : {
            "data" : {
               "lock_duration" : 7800,
               "maker_amount" : "0.6980960426276235296132151382143358058125187635655887731217178346458047624255132846296255650275651326",
               "maker_coin" : "LTC-segwit",
               "maker_coin_htlc_pubkey" : "026da2fc632afabbb1b86d04a9a012db25eca74db38ba2eccd88552f27f4c0b245",
               "maker_coin_start_block" : 2697769,
               "maker_payment_confirmations" : 2,
               "maker_payment_lock" : 1717622780,
               "maker_payment_requires_nota" : false,
               "maker_payment_trade_fee" : {
                  "amount" : "0.00000575",
                  "coin" : "LTC-segwit",
                  "paid_from_trading_vol" : false
               },
               "my_persistent_pub" : "026da2fc632afabbb1b86d04a9a012db25eca74db38ba2eccd88552f27f4c0b245",
               "p2p_privkey" : null,
               "secret" : "0000000000000000000000000000000000000000000000000000000000000000",
               "secret_hash" : "ec096d28ad636a53ac877d56363e6297b35fea49",
               "started_at" : 1717607180,
               "taker" : "8a38bafdd6c1aa3ec34c480d6ae9383bee54eef7c115e51a5aeab699734ff055",
               "taker_amount" : "57",
               "taker_coin" : "VRSC",
               "taker_coin_htlc_pubkey" : "026da2fc632afabbb1b86d04a9a012db25eca74db38ba2eccd88552f27f4c0b245",
               "taker_coin_start_block" : 3078295,
               "taker_payment_confirmations" : 5,
               "taker_payment_requires_nota" : false,
               "taker_payment_spend_trade_fee" : {
                  "amount" : "0.00001",
                  "coin" : "VRSC",
                  "paid_from_trading_vol" : true
               },
               "uuid" : "81709be1-d00f-497a-ad01-e06600668351"
            },
            "type" : "Started"
         },
         "timestamp" : 1717607180672
      },
      {
         "event" : {
            "data" : {
               "maker_coin_htlc_pubkey" : "028a38bafdd6c1aa3ec34c480d6ae9383bee54eef7c115e51a5aeab699734ff055",
               "maker_coin_swap_contract_addr" : null,
               "taker_coin_htlc_pubkey" : "028a38bafdd6c1aa3ec34c480d6ae9383bee54eef7c115e51a5aeab699734ff055",
               "taker_coin_swap_contract_addr" : null,
               "taker_payment_locktime" : 1717614981,
               "taker_pubkey" : "000000000000000000000000000000000000000000000000000000000000000000"
            },
            "type" : "Negotiated"
         },
         "timestamp" : 1717607196679
      },
      {
         "event" : {
            "data" : null,
            "type" : "MakerPaymentInstructionsReceived"
         },
         "timestamp" : 1717607198726
      },
      {
         "event" : {
            "data" : {
               "tx_hash" : "0193432f7d74292a639191a1f2c10df8d4913c0194b3cbbc3c9e3d0a49003da3",
               "tx_hex" : "0400008085202f8901f6b1e88dbb786e48d77e4792d2a99f0cc79bbfdf06623d59cbe39c22aae1899e010000006b483045022100e8eb4caeeecf58455751b87ff06ce63af4c4e3ed502078c783cabb9228d5725f02206d3168fdd5f882113933cd19452a0f0ac32ec8b033f561b66f6e5b5f24d12b600121028a38bafdd6c1aa3ec34c480d6ae9383bee54eef7c115e51a5aeab699734ff055ffffffff02e3ef6f00000000001976a914ca1e04745e8ca0c60d8c5881531d51bec470743f88acba476cd30e0000001976a914d89058fbcce7402fb342dffadf04bd32dba29abe88ac1d9b6066000000000000000000000000000000"
            },
            "type" : "TakerFeeValidated"
         },
         "timestamp" : 1717607198727
      },
      {
         "event" : {
            "data" : {
               "tx_hash" : "5771db2b6cfc3b8381ad0113882564e23a0cb1502f682725a749127aabdac328",
               "tx_hex" : "01000000000102409f4a07392ca3da7131277e9649a12292eb88b9ea4af05df6b55180729f89df0000000000ffffffff21447fbdc959f4b7c4a0a35a3dc4ccc1195108ee5fa5aa8bbccc835b482075860200000000ffffffff03c43529040000000017a9140972ccf6383b3416af02936a3bf3229b91a42956870000000000000000166a14ec096d28ad636a53ac877d56363e6297b35fea49de168e0000000000160014ed56f2feb905938b45d2e009ec14add0e7d0157202473044022053cc480403f9d2555bda58904b80b5ff10995e0344a25859e706d2ea80651a4e022001bafc2387b3d12e96b08f8fbba495185eab411878948b4b1f141f71e5aaa5be0121026da2fc632afabbb1b86d04a9a012db25eca74db38ba2eccd88552f27f4c0b2450247304402200db4fca44cfa40f1e45d2b1c0b281e6da375b3d196de6074eb091f94a83a9493022033b9a388167ba7bea148c79b4593b2fa77e6b7ebc7d2debab07f6e37c29ccc2e0121026da2fc632afabbb1b86d04a9a012db25eca74db38ba2eccd88552f27f4c0b2451e9b6066"
            },
            "type" : "MakerPaymentSent"
         },
         "timestamp" : 1717607198770
      },
      {
         "event" : {
            "data" : {
               "error" : "lp_swap:405] Timeout (4771 > 4770)"
            },
            "type" : "TakerPaymentValidateFailed"
         },
         "timestamp" : 1717612179119
      },
      {
         "event" : {
            "data" : {
               "wait_until" : 1717626480
            },
            "type" : "MakerPaymentWaitRefundStarted"
         },
         "timestamp" : 1717612179122
      },
      {
         "event" : {
            "type" : "MakerPaymentRefundStarted"
         },
         "timestamp" : 1717612179123
      },
      {
         "event" : {
            "data" : {
               "tx_hash" : "0c6f02510949493be47142c01e91ec20dc42e24d272da173da16ff5f8b8c1dc3",
               "tx_hex" : "010000000128c3daab7a1249a72527682f50b10c3ae26425881301ad81833bfc6c2bdb715700000000b647304402205748e4c81873676d99f3cd3dd6751ca358cf4366054678cfd4ea9cab5d9170ca02201373b0dbbdfe84a4f5be9d02dde4f5aa00680c2eaa61e04c9d63595bbeee881401514c6b6304fcd76066b17521026da2fc632afabbb1b86d04a9a012db25eca74db38ba2eccd88552f27f4c0b245ac6782012088a914ec096d28ad636a53ac877d56363e6297b35fea498821028a38bafdd6c1aa3ec34c480d6ae9383bee54eef7c115e51a5aeab699734ff055ac68feffffff019034290400000000160014ed56f2feb905938b45d2e009ec14add0e7d0157284d86066"
            },
            "type" : "MakerPaymentRefunded"
         },
         "timestamp" : 1717623785222
      },
      {
         "event" : {
            "type" : "MakerPaymentRefundFinished"
         },
         "timestamp" : 1717623785226
      },
      {
         "event" : {
            "type" : "Finished"
         },
         "timestamp" : 1717623785261
      }
   ],
   "gui" : "mpm",
   "maker_amount" : "0.6980960426276235296132151382143358058125187635655887731217178346458047624255132846296255650275651326",
   "maker_coin" : "LTC-segwit",
   "maker_coin_usd_price" : "84.92",
   "mm_version" : "2.0.0-beta_b0fd99e",
   "my_order_uuid" : "1fdac090-0b73-43eb-856e-9d137c6ce502",
   "success_events" : [
      "Started",
      "Negotiated",
      "MakerPaymentInstructionsReceived",
      "TakerFeeValidated",
      "MakerPaymentSent",
      "TakerPaymentReceived",
      "TakerPaymentWaitConfirmStarted",
      "TakerPaymentValidatedAndConfirmed",
      "TakerPaymentSpent",
      "TakerPaymentSpendConfirmStarted",
      "TakerPaymentSpendConfirmed",
      "Finished"
   ],
   "taker_amount" : "57",
   "taker_coin" : "VRSC",
   "taker_coin_usd_price" : "1.091",
   "type" : "Maker",
   "uuid" : "81709be1-d00f-497a-ad01-e06600668351"
}

very weird situation... user says he lost internet connection... but i wonder why tx was sent to electrumx, which sent it to the chain, but mm2 says it timed out... disconnect in the "wrong" moment?

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

1 participant