Skip to content

Commit

Permalink
Use NOT_ENOUGH_MONEY for receive FeeTooHigh error
Browse files Browse the repository at this point in the history
Perhaps it can be extended to reveal preferences about appropriate feerates with a template, but for now this
at least uses the well known error code as intended.
  • Loading branch information
DanGould committed Jan 24, 2025
1 parent 4120f5d commit 9c770f1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions payjoin/src/receive/error.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
use std::{error, fmt};

use crate::error_codes::{ORIGINAL_PSBT_REJECTED, UNAVAILABLE, VERSION_UNSUPPORTED};
use crate::error_codes::{
NOT_ENOUGH_MONEY, ORIGINAL_PSBT_REJECTED, UNAVAILABLE, VERSION_UNSUPPORTED,
};
#[cfg(feature = "v1")]
use crate::receive::v1;
#[cfg(feature = "v2")]
Expand Down Expand Up @@ -229,7 +231,7 @@ impl JsonError for PayloadError {
InputWeight(_) => serialize_json_error(ORIGINAL_PSBT_REJECTED, self),
InputSeen(_) => serialize_json_error(ORIGINAL_PSBT_REJECTED, self),
PsbtBelowFeeRate(_, _) => serialize_json_error(ORIGINAL_PSBT_REJECTED, self),
FeeTooHigh(_, _) => serialize_json_error(ORIGINAL_PSBT_REJECTED, self),
FeeTooHigh(_, _) => serialize_json_error(NOT_ENOUGH_MONEY, self),
}
}
}
Expand Down

0 comments on commit 9c770f1

Please sign in to comment.