Skip to content

Commit

Permalink
Add fee_rate to wallet_create_funded_psbt call
Browse files Browse the repository at this point in the history
fee_rate is needed in certain situations where regtest doesnt have enough
data to do fee estimation
  • Loading branch information
chris-belcher committed Jun 29, 2021
1 parent 2e78e15 commit 9ddd6db
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/wallet_sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,12 @@ impl WalletSwapCoin {
compressed: true,
key: secp256k1::PublicKey::from_secret_key(&secp, &contract_privkey),
};
assert!(contract_pubkey ==
contracts::read_hashlock_pubkey_from_contract(&contract_redeemscript).unwrap() ||
contract_pubkey ==
contracts::read_timelock_pubkey_from_contract(&contract_redeemscript).unwrap()
assert!(
contract_pubkey
== contracts::read_hashlock_pubkey_from_contract(&contract_redeemscript).unwrap()
|| contract_pubkey
== contracts::read_timelock_pubkey_from_contract(&contract_redeemscript)
.unwrap()
);
WalletSwapCoin {
my_privkey,
Expand Down Expand Up @@ -833,6 +835,7 @@ impl Wallet {
Some(WalletCreateFundedPsbtOptions {
include_watching: Some(true),
change_address: Some(change_address.clone()),
fee_rate: Some(Amount::from_btc(0.0001).unwrap()),
..Default::default()
}),
None,
Expand Down

0 comments on commit 9ddd6db

Please sign in to comment.