Skip to content

Commit

Permalink
Log warnings in release
Browse files Browse the repository at this point in the history
  • Loading branch information
DanGould committed Aug 16, 2022
1 parent ae9397e commit 39bd78c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bip78/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ base64 = "0.13.0"
rand = { version = "0.8.4", optional = true }
bip21 = "0.1.1"
url = "2.2.2"
log = "0.4.14"

[dev-dependencies]
bitcoind = { version = "0.18.0", features = ["0_21_1"] }
env_logger = "0.9.0"
log = "0.4.14"
9 changes: 7 additions & 2 deletions bip78/src/params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ impl Params {
("additionalfeeoutputindex", index) => {
if let Ok(index) = index.parse::<usize>() {
additional_fee_output_index = Some(index);
} else {
log::warn!("bad `additionalfeeoutputindex` query value");
}
},
("maxadditionalfeecontribution", fee) => {
Expand All @@ -60,8 +62,11 @@ impl Params {
_ => (),
}
}
if let (Some(amount), Some(index)) = (max_additional_fee_contribution, additional_fee_output_index) {
params.additional_fee_contribution = Some((amount, index));

match (max_additional_fee_contribution, additional_fee_output_index) {
(Some(amount), Some(index)) => params.additional_fee_contribution = Some((amount, index)),
(Some(_), None) | (None, Some(_)) => log::warn!("only one parameter specified"),
_ => ()
}

Ok(params)
Expand Down

0 comments on commit 39bd78c

Please sign in to comment.