spend: check max feerate

This commit is contained in:
edouardparis 2023-12-11 15:34:45 +01:00
parent 4ccecd1cdf
commit a7324681e1
2 changed files with 3 additions and 2 deletions

View File

@ -10,6 +10,7 @@ use liana::{
},
spend::{
create_spend, CandidateCoin, SpendCreationError, SpendOutputAddress, SpendTxFees, TxGetter,
MAX_FEERATE,
},
};
@ -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;

View File

@ -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),
)