Borrow instead of moving transaction when broadcasting

There's no need to take ownership of the transaction for a broadcast.
This commit is contained in:
Mariusz Klochowicz
2021-10-20 15:34:29 +10:30
parent d75d221540
commit 3d8efbf8bf
2 changed files with 13 additions and 13 deletions

View File

@@ -1559,8 +1559,8 @@ where
/// Broadcast a transaction to the network
#[maybe_async]
pub fn broadcast(&self, tx: Transaction) -> Result<Txid, Error> {
maybe_await!(self.client.broadcast(&tx))?;
pub fn broadcast(&self, tx: &Transaction) -> Result<Txid, Error> {
maybe_await!(self.client.broadcast(tx))?;
Ok(tx.txid())
}