Better event messages

This commit is contained in:
nicolas.dorier 2020-03-11 21:11:07 +09:00
parent 95f859b6db
commit c8e1db2102
No known key found for this signature in database
GPG Key ID: 6618763EF09186FE
2 changed files with 7 additions and 1 deletions

View File

@ -6,5 +6,11 @@ namespace BTCPayServer.Events
{
public NewTransactionEvent NewTransactionEvent { get; set; }
public string CryptoCode { get; set; }
public override string ToString()
{
var state = NewTransactionEvent.BlockId == null ? "Unconfirmed" : "Confirmed";
return $"{CryptoCode}: New transaction {NewTransactionEvent.TransactionData.TransactionHash} ({state})";
}
}
}

View File

@ -346,7 +346,7 @@ namespace BTCPayServer.Payments.Bitcoin
var address = await wallet.ReserveAddressAsync(strategy);
btc.DepositAddress = address.Address.ToString();
await _InvoiceRepository.NewAddress(invoice.Id, btc, wallet.Network);
_Aggregator.Publish(new InvoiceNewAddressEvent(invoice.Id, address.ToString(), wallet.Network));
_Aggregator.Publish(new InvoiceNewAddressEvent(invoice.Id, btc.DepositAddress, wallet.Network));
paymentMethod.SetPaymentMethodDetails(btc);
invoice.SetPaymentMethod(paymentMethod);
}