Skip to content

Commit

Permalink
throwing error after DB updated failed
Browse files Browse the repository at this point in the history
  • Loading branch information
RodriFS committed Jul 24, 2023
1 parent a8b3313 commit 9fab700
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Data/Models/ChannelOperationRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public enum ChannelOperationRequestStatus
Failed = 8,

/// <summary>
/// The PSBT is being funded and signed by NodeGuard
/// The PSBT is being signed by NodeGuard after all human required signatures have been collected
/// </summary>
FinalizingPSBT = 9
}
Expand Down
2 changes: 1 addition & 1 deletion src/Data/Models/WalletWithdrawalRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public enum WalletWithdrawalRequestStatus
Failed = 6,

/// <summary>
/// The PSBT is being signed by NodeGuard
/// The PSBT is being signed by NodeGuard after all human required signatures have been collected
/// </summary>
FinalizingPSBT = 7
}
Expand Down
4 changes: 3 additions & 1 deletion src/Services/BitcoinService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,10 @@ public async Task PerformWithdrawal(WalletWithdrawalRequest walletWithdrawalRequ
var (isSuccess, error) = _walletWithdrawalRequestRepository.Update(walletWithdrawalRequest);
if (!isSuccess)
{
_logger.LogWarning("Request in remote signing stage, but could not update status to {Status} for request id: {RequestId} reason: {Reason}",
var errorMessage = string.Format("Request in remote signing stage, but could not update status to {Status} for request id: {RequestId} reason: {Reason}",
WalletWithdrawalRequestStatus.FinalizingPSBT, walletWithdrawalRequest.Id, error);
_logger.LogWarning(errorMessage);
throw new Exception(errorMessage);
}

PSBT? psbtToSign = null;
Expand Down
4 changes: 3 additions & 1 deletion src/Services/LightningService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -395,8 +395,10 @@ public async Task OpenChannel(ChannelOperationRequest channelOperationRequest)
var (isSuccess, error) = _channelOperationRequestRepository.Update(channelOperationRequest);
if (!isSuccess)
{
_logger.LogWarning("Request in funding stage, but could not update status to {Status} for request id: {RequestId} reason: {Reason}",
var errorMessage = string.Format("Request in funding stage, but could not update status to {Status} for request id: {RequestId} reason: {Reason}",
ChannelOperationRequestStatus.FinalizingPSBT, channelOperationRequest.Id, error);
_logger.LogError(errorMessage);
throw new Exception(errorMessage);
}

//We got the funded PSBT, we need to tweak the tx outputs and mimick lnd-cli calls
Expand Down

0 comments on commit 9fab700

Please sign in to comment.