mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-12-10 22:35:45 -05:00
Bitcoin network check when building PSBT
This ensures that funds are not sent to an address on the wrong network.
This commit is contained in:
parent
c164f3d1f5
commit
202f6d1fa0
2 changed files with 6 additions and 0 deletions
|
|
@ -303,6 +303,10 @@ where
|
|||
address: Address,
|
||||
amount: Amount,
|
||||
) -> Result<PartiallySignedTransaction> {
|
||||
if self.network != address.network {
|
||||
bail!("Cannot build PSBT because network of given address is {} but wallet is on network {}", address.network, self.network);
|
||||
}
|
||||
|
||||
let wallet = self.wallet.lock().await;
|
||||
let client = self.client.lock().await;
|
||||
let fee_rate = client.estimate_feerate(self.target_block)?;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue