From 1404057dbe68b60594f1f663d664c659fed6f694 Mon Sep 17 00:00:00 2001 From: Daniel Karzel Date: Wed, 24 Feb 2021 17:01:24 +1100 Subject: [PATCH] Remove misleading TODO This TDOO is misleading, because - to our current knowledge - it is impossible for Bob to retrieve the exact inclusion block-height of the lock transaction (send by Alice). The wallet RPC is only capable of retrieving the inclusion block height of a transaction through `get_payments` and `get_bulk_payments` which requires the `payment_id`. The `payment_id` can be retrieved through `get_transfer_by_txid` which states "Show information about a transfer to/from this address." - however the address that the transfer goes to is not part of Bob's wallet yet! Thus, it is impossible for Bob to use `get_transfer_by_txid` which in turn means Bob is unable to use `get_payments`. The only possible way for Bob to know the exact inclusion block/height of the lock transaction would be if Alice sends it over to Bob. But for that Alice would have to extract it she would have to wait for confirmation - which she currently does not and might never do. Even if she does await the first confirmation before sending the transfer proof the solution for retrieving the inclusion block-height is not fleshed out on her side yet. --- swap/src/protocol/bob/swap.rs | 3 --- 1 file changed, 3 deletions(-) diff --git a/swap/src/protocol/bob/swap.rs b/swap/src/protocol/bob/swap.rs index a6b75316..628462cc 100644 --- a/swap/src/protocol/bob/swap.rs +++ b/swap/src/protocol/bob/swap.rs @@ -129,9 +129,6 @@ async fn run_until_internal( // Record the current monero wallet block height so we don't have to scan from // block 0 once we create the redeem wallet. - // TODO: This can be optimized further by extracting the block height when - // tx-lock was included. However, scanning a few more blocks won't do any harm - // and is simpler. let monero_wallet_restore_blockheight = monero_wallet.block_height().await?; select! {