diba-io / bitmask-core

Core functionality for the BitMask wallet
https://bitmask.app
Other
95 stars 21 forks source link

replace Esplora::broadcast with direct request #365

Closed josediegorobles closed 11 months ago

josediegorobles commented 1 year ago

When the error reported here: https://github.com/diba-io/bitmask-core/issues/364 and maybe in other occasions, all process are done but the transaction is not sent to the blockchain.

So, we need:

cryptoquick commented 1 year ago

Thank you for filing this, I've been experiencing the same issues.

crisdut commented 1 year ago

The problem occurs because the PSBT was created with wrong way (Please, see PR #366 ).

Also, ExploraBlockchain::broadcast method is badly to troubleshooting transaction error, because the method does not display the problem that caused the badrequest:.

/// Broadcast a [`Transaction`] to Esplora
pub async fn broadcast(&self, transaction: &Transaction) -> Result<(), Error> {
    self.client
        .post(&format!("{}/tx", self.url))
        .body(serialize(transaction).to_hex())
        .send()
        .await?
        .error_for_status()?;

    Ok(())
}

I suggest changing this issue to "replace Esplora::broadcast with direct request"