Skip to content

Commit c00ee91

Browse files
committed
Add additional options to sendtoaddress as per 0.21.0 docs
Docs: https://bitcoincore.org/en/doc/0.21.0/rpc/wallet/sendtoaddress/
1 parent 27d3543 commit c00ee91

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

client/src/client.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,6 @@ fn handle_defaults<'a, 'b>(
121121
let defaults_i = defaults.len() - 1 - i;
122122
if args[args_i] == serde_json::Value::Null {
123123
if first_non_null_optional_idx.is_some() {
124-
if defaults[defaults_i] == serde_json::Value::Null {
125-
panic!("Missing `default` for argument idx {}", args_i);
126-
}
127124
args[args_i] = defaults[defaults_i].clone();
128125
}
129126
} else if first_non_null_optional_idx.is_none() {
@@ -888,6 +885,8 @@ pub trait RpcApi: Sized {
888885
replaceable: Option<bool>,
889886
confirmation_target: Option<u32>,
890887
estimate_mode: Option<json::EstimateMode>,
888+
avoid_reuse: Option<bool>,
889+
fee_rate: Option<i32>,
891890
) -> Result<bitcoin::Txid> {
892891
let mut args = [
893892
address.to_string().into(),
@@ -898,12 +897,14 @@ pub trait RpcApi: Sized {
898897
opt_into_json(replaceable)?,
899898
opt_into_json(confirmation_target)?,
900899
opt_into_json(estimate_mode)?,
900+
opt_into_json(avoid_reuse)?,
901+
opt_into_json(fee_rate)?,
901902
];
902903
self.call(
903904
"sendtoaddress",
904905
handle_defaults(
905906
&mut args,
906-
&["".into(), "".into(), false.into(), false.into(), 6.into(), null()],
907+
&["".into(), "".into(), false.into(), false.into(), null(), null(), null(), null()],
907908
),
908909
)
909910
}

0 commit comments

Comments
 (0)