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

KMD swaps failing at "TakerPaymentSpendFailed" #1304

Closed
borngraced opened this issue Jun 3, 2022 · 4 comments
Closed

KMD swaps failing at "TakerPaymentSpendFailed" #1304

borngraced opened this issue Jun 3, 2022 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@borngraced
Copy link
Member

borngraced commented Jun 3, 2022

swaps are failing when KMD is the base_coin with the error attempt to subtract with overflow which led to TakerPaymentSpendFailed. This error specific to only KMD so far...

base coin = KMD
rel coin = NMC

Error trace:
mm2src/coins/utxo/utxo_common.rs:1160:20.

Cause:
value seems to be greater than fee in the case of KMD leading to attempt to subtract with overflow

Transaction Log

{
  "type": "Maker",
  "uuid": "22340d17-3af3-410b-9fee-dc6e86df9ac0",
  "my_order_uuid": "b6ad5f49-8da3-4db8-9ab6-8b88aa08809c",
  "events": [
    {
      "timestamp": 1654260331358,
      "event": {
        "type": "Started",
        "data": {
          "taker_coin": "NMC",
          "maker_coin": "KMD",
          "taker": "031d4256c4bc9f99ac88bf3dba21773132281f65f9bf23a59928bce08961e2f3",
          "secret": "5bee7bf7bc90cfbb268fc63a2449a6228c1833222ee7a3bc4e5c91be9c373fc8",
          "secret_hash": "e810ac053a7713cc6bb359dec450a0b4b5347e7d",
          "my_persistent_pub": "022a020b37fd4113676c619c0244fb90dc5921a8f101e786dfd2dd4255c61aebcf",
          "lock_duration": 31200,
          "maker_amount": "0.01",
          "taker_amount": "0.0001",
          "maker_payment_confirmations": 2,
          "maker_payment_requires_nota": true,
          "taker_payment_confirmations": 2,
          "taker_payment_requires_nota": false,
          "maker_payment_lock": 1654322731,
          "uuid": "22340d17-3af3-410b-9fee-dc6e86df9ac0",
          "started_at": 1654260331,
          "maker_coin_start_block": 2933669,
          "taker_coin_start_block": 614854,
          "maker_payment_trade_fee": {
            "coin": "KMD",
            "amount": "0.00001",
            "paid_from_trading_vol": false
          },
          "taker_payment_spend_trade_fee": {
            "coin": "NMC",
            "amount": "0.00030887",
            "paid_from_trading_vol": true
          },
          "maker_coin_htlc_privkey": null,
          "maker_coin_htlc_pubkey": "022a020b37fd4113676c619c0244fb90dc5921a8f101e786dfd2dd4255c61aebcf",
          "taker_coin_htlc_privkey": null,
          "taker_coin_htlc_pubkey": "022a020b37fd4113676c619c0244fb90dc5921a8f101e786dfd2dd4255c61aebcf",
          "p2p_privkey": null
        }
      }
    },
    {
      "timestamp": 1654260332361,
      "event": {
        "type": "Negotiated",
        "data": {
          "taker_payment_locktime": 1654291530,
          "taker_pubkey": "000000000000000000000000000000000000000000000000000000000000000000",
          "maker_coin_swap_contract_addr": null,
          "taker_coin_swap_contract_addr": null,
          "maker_coin_htlc_pubkey": "02031d4256c4bc9f99ac88bf3dba21773132281f65f9bf23a59928bce08961e2f3",
          "taker_coin_htlc_pubkey": "02031d4256c4bc9f99ac88bf3dba21773132281f65f9bf23a59928bce08961e2f3"
        }
      }
    },
    {
      "timestamp": 1654260334561,
      "event": {
        "type": "TakerFeeValidated",
        "data": {
          "tx_hex": "010000000162380c1739de0abf9439e8788904bf05427f0c3c35cd79d78e9aa954297c07d9020000006a47304402202dc366c31ad6be955054955a884f2504b32ba011457cfa30f92245445fa1d7bc02200410773eed75b5c697ba3017b91265d0cd8ac456135e9bf53faa88d153b99d4a012102031d4256c4bc9f99ac88bf3dba21773132281f65f9bf23a59928bce08961e2f3ffffffff0210270000000000001976a914ca1e04745e8ca0c60d8c5881531d51bec470743f88ac32bc0c00000000001976a91405aab5342166f8594baf17a7d9bef5d56744332788ac6d029a62",
          "tx_hash": "721d609b492477d094e6b4654e6cf3601e68b85d7cf6ad467bdb62fecfdf4650"
        }
      }
    },
    {
      "timestamp": 1654260335948,
      "event": {
        "type": "MakerPaymentSent",
        "data": {
          "tx_hex": "0400008085202f89027b5f00a3fceaeb2d4980ac0f12d9239214448df01e41e0ecf497c8aea1ce9b38020000006a47304402204b9a03daf4f800bfb7bd11af688dc22e6dfde4abd4b122fe672cfa236b760a4702206376cfd516af96a6baa8b77a7e995c25ca6410a7a2601608b4c81c5b886bd00d0121022a020b37fd4113676c619c0244fb90dc5921a8f101e786dfd2dd4255c61aebcfffffffffd9e8019ed250d73216d1ce0ffe6987a2074c876f083b7095877bed50e485172a000000006b48304502210090653c25dfb9a72b2f788a86a4c6218991ad3cf77214cda6bc5bb520c968e9dc02206e5f4fea96c575e3f98a1c9dd38f6601c14b5730670a2a83e205cfd4094989ad0121022a020b37fd4113676c619c0244fb90dc5921a8f101e786dfd2dd4255c61aebcfffffffff0340420f000000000017a9147fca455801500fd324d050145e71c8fd0c8061d8870000000000000000166a14e810ac053a7713cc6bb359dec450a0b4b5347e7da91c0600000000001976a914d3d2753b154679bb76a3e5161f7c403e5073647b88ac71fa9962000000000000000000000000000000",
          "tx_hash": "322619eabc409d28edfbe0f4d98b1fd4002888505c41e9e78c44439bd639d78b"
        }
      }
    },
    {
      "timestamp": 1654262591035,
      "event": {
        "type": "TakerPaymentReceived",
        "data": {
          "tx_hex": "01000000015046dfcffe62db7b46adf67c5db8681e60f36c4e65b4e694d07724499b601d72010000006a47304402207b006eb63c6236f0739b9fe4a3ff8c7947dd9bae07d18d768c9ecdf4e7b44ad6022009aa43a8256d84bb166f1382024d03ef56091dcf0482832cb748c0118cadf2de012102031d4256c4bc9f99ac88bf3dba21773132281f65f9bf23a59928bce08961e2f3ffffffff03102700000000000017a91443bf65135bb8fb06efbbec860ed09a85fb64cc23870000000000000000166a14e810ac053a7713cc6bb359dec450a0b4b5347e7d42300c00000000001976a91405aab5342166f8594baf17a7d9bef5d56744332788ac3e0b9a62",
          "tx_hash": "a95c5550fe2608163a8f4d4d996100ace1ff21b020eb330b34a9aa9447a6eaba"
        }
      }
    },
    {
      "timestamp": 1654262591038,
      "event": { "type": "TakerPaymentWaitConfirmStarted" }
    },
    {
      "timestamp": 1654263967329,
      "event": { "type": "TakerPaymentValidatedAndConfirmed" }
    },
    {
      "timestamp": 1654275352241,
      "event": {
        "type": "TakerPaymentSpendFailed",
        "data": {
          "error": "maker_swap:876] !taker_coin.send_maker_spends_taker_payment: mm2src/coins/utxo/utxo_common.rs:1181] MmError { etype: ResponseParseError(JsonRpcError { client_info: \"coin: NMC\", request: JsonRpcRequest { jsonrpc: \"2.0\", id: \"16\", method: \"blockchain.transaction.broadcast\", params: [String(\"0100000001baeaa64794aaa9340b33eb20b021ffe1ac0061994d4d8f3a160826fe50555ca900000000d8483045022100ea17f6da9ebcf38cd88388380a57bc6b6e02d3efcfba8ecbe33978362a76920002202404095ee73ea8ab3068d8fa42fcddec3d75a14f168ac6203045f586478390b201205bee7bf7bc90cfbb268fc63a2449a6228c1833222ee7a3bc4e5c91be9c373fc8004c6b63044a7c9a62b1752102031d4256c4bc9f99ac88bf3dba21773132281f65f9bf23a59928bce08961e2f3ac6782012088a914e810ac053a7713cc6bb359dec450a0b4b5347e7d8821022a020b37fd4113676c619c0244fb90dc5921a8f101e786dfd2dd4255c61aebcfac68ffffffff0197510000000000001976a914d3d2753b154679bb76a3e5161f7c403e5073647b88ac94af626e\")] }, error: Response(nmc.bitcoins.sk:50001, Object({\"code\": Number(1), \"message\": String(\"the transaction was rejected by network rules.\\n\\nbad-txns-in-belowout, value in (0.0001) < value out (0.00020887) (code 16)\\n[0100000001baeaa64794aaa9340b33eb20b021ffe1ac0061994d4d8f3a160826fe50555ca900000000d8483045022100ea17f6da9ebcf38cd88388380a57bc6b6e02d3efcfba8ecbe33978362a76920002202404095ee73ea8ab3068d8fa42fcddec3d75a14f168ac6203045f586478390b201205bee7bf7bc90cfbb268fc63a2449a6228c1833222ee7a3bc4e5c91be9c373fc8004c6b63044a7c9a62b1752102031d4256c4bc9f99ac88bf3dba21773132281f65f9bf23a59928bce08961e2f3ac6782012088a914e810ac053a7713cc6bb359dec450a0b4b5347e7d8821022a020b37fd4113676c619c0244fb90dc5921a8f101e786dfd2dd4255c61aebcfac68ffffffff0197510000000000001976a914d3d2753b154679bb76a3e5161f7c403e5073647b88ac94af626e]\")})) }), trace: [TraceLocation { file: \"rpc_clients\", line: 1944 }] }"
        }
      }
    },
    {
      "timestamp": 1654275352246,
      "event": {
        "type": "MakerPaymentWaitRefundStarted",
        "data": { "wait_until": 1654326431 }
      }
    }
  ],
  "maker_amount": "0.01",
  "maker_coin": "KMD",
  "maker_coin_usd_price": null,
  "taker_amount": "0.0001",
  "taker_coin": "NMC",
  "taker_coin_usd_price": null,
  "gui": "nogui",
  "mm_version": "be385cd9e",
  "success_events": [
    "Started",
    "Negotiated",
    "TakerFeeValidated",
    "MakerPaymentSent",
    "TakerPaymentReceived",
    "TakerPaymentWaitConfirmStarted",
    "TakerPaymentValidatedAndConfirmed",
    "TakerPaymentSpent",
    "TakerPaymentSpendConfirmStarted",
    "TakerPaymentSpendConfirmed",
    "Finished"
  ],
  "error_events": [
    "StartFailed",
    "NegotiateFailed",
    "TakerFeeValidateFailed",
    "MakerPaymentTransactionFailed",
    "MakerPaymentDataSendFailed",
    "MakerPaymentWaitConfirmFailed",
    "TakerPaymentValidateFailed",
    "TakerPaymentWaitConfirmFailed",
    "TakerPaymentSpendFailed",
    "TakerPaymentSpendConfirmFailed",
    "MakerPaymentWaitRefundStarted",
    "MakerPaymentRefunded",
    "MakerPaymentRefundFailed"
  ]
}
@borngraced borngraced added the bug Something isn't working label Jun 3, 2022
@borngraced borngraced self-assigned this Jun 3, 2022
@borngraced
Copy link
Member Author

@shamardy can this be closed now?

@borngraced
Copy link
Member Author

this issue was fixed in #1457 so this can be closed now @shamardy

@tonymorony
Copy link

(fat fingered while read so reopened)

@shamardy
Copy link
Collaborator

Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants