Skip to content

Commit

Permalink
Tratamento de errro na exportação.
Browse files Browse the repository at this point in the history
  • Loading branch information
clebermacieski committed Jun 16, 2019
1 parent c4cdd2d commit 56b62ab
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,16 @@ public static bool PropagarTransacao(Transaction transacao , Network rede)

if (!broadcastResponse.Success)
{
Console.Error.WriteLine("ErrorCode: " + broadcastResponse.Error.ErrorCode);
Console.Error.WriteLine("Error message: " + broadcastResponse.Error.Reason);
/*Console.Error.WriteLine("ErrorCode: " + broadcastResponse.Error.ErrorCode);
Console.Error.WriteLine("Error message: " + broadcastResponse.Error.Reason);*/
return false;
}
else
{
/*Console.WriteLine("Success! You can check out the hash of the transaciton in any block explorer:");
Console.WriteLine(transacao.GetHash());*/
return true;
}

return false;
}

public static String RetornarSaldo(BitcoinSecret segredo, Network rede)
Expand Down
11 changes: 9 additions & 2 deletions ArbitroBitcoin/ArbitroBitcoin/ViewModels/EnviarViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,18 @@ private async Task EnviarTransacao()
if (ExportSwitch)
{
MessagingCenter.Send(this, "erro_exportar");
//Exportar(string destino, decimal valorAEnviar)
//TODO: Exportar(string destino, decimal valorAEnviar)
}
else
{
await Task.Run(() => resultado = Negociador.Enviar(EnderecoDestino, Valor));
try
{
await Task.Run(() => resultado = Negociador.Enviar(EnderecoDestino, Valor));
}
catch
{
MessagingCenter.Send(this, "erro_envio");
}
if (!resultado)
{
MessagingCenter.Send(this, "erro_envio");
Expand Down

0 comments on commit 56b62ab

Please sign in to comment.