[wallet] Add force_non_witness_utxo() to TxBuilder

This commit is contained in:
Alekos Filini
2020-08-08 12:06:40 +02:00
parent 8d9ccf8d0b
commit c90c752f21
6 changed files with 40 additions and 19 deletions

View File

@@ -68,7 +68,7 @@ impl OnlineBlockchain for ElectrumBlockchain {
.map(|_| ())?)
}
fn get_height(&self) -> Result<usize, Error> {
fn get_height(&self) -> Result<u32, Error> {
// TODO: unsubscribe when added to the client, or is there a better call to use here?
Ok(self
@@ -76,7 +76,7 @@ impl OnlineBlockchain for ElectrumBlockchain {
.as_ref()
.ok_or(Error::OfflineClient)?
.block_headers_subscribe()
.map(|data| data.height)?)
.map(|data| data.height as u32)?)
}
fn estimate_fee(&self, target: usize) -> Result<FeeRate, Error> {

View File

@@ -93,7 +93,7 @@ impl OnlineBlockchain for EsploraBlockchain {
._broadcast(tx))?)
}
fn get_height(&self) -> Result<usize, Error> {
fn get_height(&self) -> Result<u32, Error> {
Ok(await_or_block!(self
.0
.as_ref()
@@ -153,7 +153,7 @@ impl UrlClient {
Ok(())
}
async fn _get_height(&self) -> Result<usize, EsploraError> {
async fn _get_height(&self) -> Result<u32, EsploraError> {
let req = self
.client
.get(&format!("{}/api/blocks/tip/height", self.url))

View File

@@ -64,7 +64,7 @@ pub trait OnlineBlockchain: Blockchain {
fn get_tx(&self, txid: &Txid) -> Result<Option<Transaction>, Error>;
fn broadcast(&self, tx: &Transaction) -> Result<(), Error>;
fn get_height(&self) -> Result<usize, Error>;
fn get_height(&self) -> Result<u32, Error>;
fn estimate_fee(&self, target: usize) -> Result<FeeRate, Error>;
}