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

Ugly hack to fix issue 63 #64

Merged
merged 1 commit into from
May 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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