Skip to content

Commit

Permalink
Pay a fixed fee when sending transactions (#314)
Browse files Browse the repository at this point in the history
  • Loading branch information
terror authored Aug 16, 2022
1 parent e617773 commit 3bdc256
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use {
template::Bip84,
wallet::{signer::SignOptions, AddressIndex::LastUnused},
wallet::{wallet_name_from_descriptor, SyncOptions},
KeychainKind, LocalUtxo,
FeeRate, KeychainKind, LocalUtxo,
},
bitcoin::{
blockdata::constants::COIN_VALUE,
Expand Down
4 changes: 2 additions & 2 deletions src/subcommand/wallet/send.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ impl Send {

builder
.manually_selected_only()
.fee_absolute(0)
.fee_rate(FeeRate::from_sat_per_vb(2.0))
.add_utxo(utxo.outpoint)?
.add_recipient(self.address.script_pubkey(), utxo.txout.value);
.drain_to(self.address.script_pubkey());

builder.finish()?
};
Expand Down
2 changes: 1 addition & 1 deletion tests/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ fn send_owned_ordinal() {
wallet.list_unspent().unwrap().first().unwrap().outpoint
))
.expected_status(0)
.expected_stdout("[5000000000,10000000000)\n")
.expected_stdout("[5000000000,9999999780)\n")
.run()
}

Expand Down

0 comments on commit 3bdc256

Please sign in to comment.