mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-10-12 05:20:53 -04:00
Move log messages to the appropriate abstraction layer
Log messages are ideally as close to the functionality they are talking about, otherwise we might end up repeating ourselves on several callsites or the log messages gets outdated if the behaviour changes.
This commit is contained in:
parent
b8df4a3145
commit
7387884e6d
8 changed files with 28 additions and 20 deletions
|
@ -179,10 +179,15 @@ impl SignTxLock for Wallet {
|
|||
#[async_trait]
|
||||
impl BroadcastSignedTransaction for Wallet {
|
||||
async fn broadcast_signed_transaction(&self, transaction: Transaction) -> Result<Txid> {
|
||||
tracing::debug!("attempting to broadcast tx: {}", transaction.txid());
|
||||
self.inner.lock().await.broadcast(transaction.clone())?;
|
||||
tracing::info!("Bitcoin tx broadcasted! TXID = {}", transaction.txid());
|
||||
Ok(transaction.txid())
|
||||
let txid = transaction.txid();
|
||||
|
||||
self.inner
|
||||
.lock()
|
||||
.await
|
||||
.broadcast(transaction)
|
||||
.with_context(|| format!("failed to broadcast transaction {}", txid))?;
|
||||
|
||||
Ok(txid)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue