Skip to content

Commit

Permalink
ugly hack to fix issue 63
Browse files Browse the repository at this point in the history
  • Loading branch information
miladsoft authored May 26, 2023
2 parents 00f2660 + 0c788ff commit f3fe1c0
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/Blockcore.AtomicSwaps.Client/Pages/ViewSwap.razor
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,10 @@
if (swap.SwapMaker.SenderPubkey != mypubkeyMakerSide)
throw new Exception("Maker pubkey was changed");

await BuildSideSwap1(swap.SwapMaker, DateTime.UtcNow.AddHours(48));
var res = await BuildSideSwap1(swap.SwapMaker, DateTime.UtcNow.AddHours(48));

// ugly hack to fix issue 63 https://github.com/block-core/blockcore-atomic-swaps/issues/63
swap.SwapMaker = res;

await PostSwap(swap);

Expand All @@ -614,8 +617,10 @@
if (swap.SwapTaker.SenderPubkey != mypubkeyTakerSide)
throw new Exception("Taker pubkey was changed");

await BuildSideSwap1(swap.SwapTaker, swap.SwapMaker.RecoveryLockTime.Value.AddHours(-24));

var res = await BuildSideSwap1(swap.SwapTaker, swap.SwapMaker.RecoveryLockTime.Value.AddHours(-24));

// ugly hack to fix issue 63 https://github.com/block-core/blockcore-atomic-swaps/issues/63
swap.SwapTaker = res;

await PostSwap(swap);

Expand All @@ -624,7 +629,7 @@
await this.BlockchainApiService.Broadcast(swap.SwapTaker.CoinSymbol, swap.SwapTaker.SwapTransactionHex);
}

private async Task BuildSideSwap1(SwapSessionCoin swapSessionCoin, DateTime recoveryLockTime)
private async Task<SwapSessionCoin> BuildSideSwap1(SwapSessionCoin swapSessionCoin, DateTime recoveryLockTime)
{
ExtKey.UseBCForHMACSHA512 = true;
NBitcoin.Crypto.Hashes.UseBCForHMACSHA512 = true;
Expand Down Expand Up @@ -675,6 +680,8 @@
Logger.LogWarning("trxid was null");
Logger.LogWarning("trxhex=" + trxContext.transactionHex);
}

return swapSessionCoin;
}

//private async Task BuildSideSwap(SwapSessionCoin swapSessionCoin, DateTime recoveryLockTime)
Expand Down

0 comments on commit f3fe1c0

Please sign in to comment.