private async Task RetryBroadcast(IMultipleCashout currentMultiCashout) { if (currentMultiCashout.TryCount > MaxMultiCashoutTryCount) { await CloseMultiCashout(currentMultiCashout); return; } await _multiCashoutRepository.IncreaseTryCount(currentMultiCashout.MultipleCashoutId); var cashouts = await _cashoutRequestRepository.GetCashoutRequests(currentMultiCashout.MultipleCashoutId); var tx = new Transaction(currentMultiCashout.TransactionHex); await _bitcoinBroadcastService.BroadcastTransaction(currentMultiCashout.MultipleCashoutId, cashouts.Select(o => o.CashoutRequestId).ToList(), tx); await _multiCashoutRepository.CompleteMultiCashout(currentMultiCashout.MultipleCashoutId); SendCompleteCashoutEvents(cashouts, tx.GetHash().ToString()); }
private async Task CloseMultiCashout(IMultipleCashout currentMultiCashout) { await _multiCashoutRepository.CloseMultiCashout(currentMultiCashout.MultipleCashoutId); await _slackNotifier.ErrorAsync($"Bitcoin: can't broadcast multicashout {currentMultiCashout.MultipleCashoutId}"); }