Skip to content

Commit

Permalink
spend: check max feerate
Browse files Browse the repository at this point in the history
  • Loading branch information
edouardparis committed Dec 12, 2023
1 parent 4ccecd1 commit a732468
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion gui/src/app/state/spend/step.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use liana::{
},
spend::{
create_spend, CandidateCoin, SpendCreationError, SpendOutputAddress, SpendTxFees, TxGetter,
MAX_FEERATE,
},
};

Expand Down Expand Up @@ -346,7 +347,7 @@ impl Step for DefineSpend {
view::CreateSpendMessage::FeerateEdited(s) => {
if let Ok(value) = s.parse::<u64>() {
self.feerate.value = s;
self.feerate.valid = value != 0;
self.feerate.valid = value != 0 && value <= MAX_FEERATE;
} else if s.is_empty() {
self.feerate.value = "".to_string();
self.feerate.valid = true;
Expand Down
2 changes: 1 addition & 1 deletion gui/src/app/view/spend/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ pub fn create_spend_tx<'a>(
Message::CreateSpend(CreateSpendMessage::FeerateEdited(msg))
},
)
.warning("Invalid feerate")
.warning("Feerate must be an integer less than or equal to 1000 sats/vbyte")
.size(20)
.padding(10),
)
Expand Down

0 comments on commit a732468

Please sign in to comment.