[repl] Add broadcast command

This commit is contained in:
Alekos Filini
2020-04-21 16:39:00 +02:00
parent f605f4b34d
commit 3895b30083
2 changed files with 20 additions and 2 deletions

View File

@@ -1062,7 +1062,7 @@ where
Ok(())
}
pub fn broadcast(&mut self, psbt: PSBT) -> Result<Transaction, Error> {
pub fn broadcast(&self, psbt: PSBT) -> Result<(Txid, Transaction), Error> {
let extracted = psbt.extract_tx();
self.client
.as_ref()
@@ -1070,6 +1070,6 @@ where
.borrow_mut()
.transaction_broadcast(&extracted)?;
Ok(extracted)
Ok((extracted.txid(), extracted))
}
}