Skip to content

Commit 6ff2d7f

Browse files
committed
Consistently use _msat suffix for msat amounts
1 parent cdb1118 commit 6ff2d7f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/payment/unified.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,12 +182,12 @@ impl UnifiedPayment {
182182

183183
let resolved = match instructions {
184184
PaymentInstructions::ConfigurableAmount(instr) => {
185-
let amount = amount_msat.ok_or_else(|| {
185+
let amount_msat = amount_msat.ok_or_else(|| {
186186
log_error!(self.logger, "No amount specified. Aborting the payment.");
187187
Error::InvalidAmount
188188
})?;
189189

190-
let amt = BPIAmount::from_milli_sats(amount).map_err(|e| {
190+
let amt = BPIAmount::from_milli_sats(amount_msat).map_err(|e| {
191191
log_error!(self.logger, "Error while converting amount : {:?}", e);
192192
Error::InvalidAmount
193193
})?;
@@ -210,8 +210,8 @@ impl UnifiedPayment {
210210
})?
211211
},
212212
PaymentInstructions::FixedAmount(instr) => {
213-
if let Some(user_amount) = amount_msat {
214-
if instr.max_amount().map_or(false, |amt| user_amount < amt.milli_sats()) {
213+
if let Some(user_amount_msat) = amount_msat {
214+
if instr.max_amount().map_or(false, |amt| user_amount_msat < amt.milli_sats()) {
215215
log_error!(self.logger, "Amount specified is less than the amount in the parsed URI. Aborting the payment.");
216216
return Err(Error::InvalidAmount);
217217
}

0 commit comments

Comments
 (0)