blocknetdx / blocknet

Official Blocknet cryptocurrency wallet
https://www.blocknet.org
MIT License
214 stars 94 forks source link

DX trades sometimes fail with "msg": "bad locktime from counterparty, canceling" #592

Open walkjivefly opened 3 years ago

walkjivefly commented 3 years ago

DX trades sometimes fail due to incorrect/unexpected locktimes.

For properly configured, properly behaving, synced nodes/wallets they should complete normally every time.

I tried to take 3 BLOCK/LTC orders on 1 October using CLI

blocknet-cli dxTakeOrder 674c069315400febdb722ff6304d686c6d1977119d3a65410fc9f2ab7cd9ff4e <send address> <receive address>

The trade did not complete. Checking the xbridgep2p log for this order showed that it failed with

...
[I] 2021-Oct-01 11:29:36 [0x7f0710672700]
{
    "orderid": "674c069315400febdb722ff6304d686c6d1977119d3a65410fc9f2ab7cd9ff4e",
    "expected_counterparty_locktime": 2132299,
    "counterparty_locktime": 2132292,
    "function": "processTransactionCreateB",
    "msg": "bad locktime from counterparty, canceling"
}

[I] 2021-Oct-01 11:29:36 [0x7f0710672700]
{
    "orderid": "674c069315400febdb722ff6304d686c6d1977119d3a65410fc9f2ab7cd9ff4e",
    "cancel_reason": "crBadALockTime",
    "function": "sendCancelTransaction",
    "msg": "canceling order, initiated by me"
}

[I] 2021-Oct-01 11:29:36 [0x7f0710672700]
{
    "orderid": "674c069315400febdb722ff6304d686c6d1977119d3a65410fc9f2ab7cd9ff4e",
    "cancel_reason": "crBadALockTime",
    "function": "processTransactionCancel",
    "err_msg": "counterparty cancel request"
}
...

Taker BLOCK and LTC wallets were synced, unlocked and operating normally. I believe the same is true at the maker side. Tried 2 further times, order ids

Blocknet version v4.3.3.0-698e09fea on MX 19.3 and Ubuntu 18.04

walkjivefly commented 3 years ago

Further testing suggests the problem may be the LTC wallet used in this attempt was using pruning (I've used several different copies of different coins for testing and at some point switched on pruning for this particular one).

A test take of DASH/BLOCK worked OK. A test take of BLOCK/LTC with a different (definitely not pruned) LTC wallet worked OK.

If the failure really is caused by pruning it would be helpful if the error message actually made that clear.