Skip to content

Commit

Permalink
Add specific error code for invalid custom TLVs.
Browse files Browse the repository at this point in the history
  • Loading branch information
rdmitr committed Mar 1, 2024
1 parent e7984c3 commit 4ca0953
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ pub enum Error {
InvalidChannelId,
/// The given network is invalid.
InvalidNetwork,
/// The custom TLVs are invalid.
InvalidCustomTlv,
/// A payment with the given hash has already been initiated.
DuplicatePayment,
/// The available funds are insufficient to complete the given operation.
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1257,7 +1257,7 @@ impl<K: KVStore + Sync + Send + 'static> Node<K> {
.with_custom_tlvs(custom_tlvs.into_iter().map(|tlv| (tlv.r#type, tlv.value)).collect())
.map_err(|_| {
log_error!(self.logger, "Payment error: invalid custom TLVs.");
Error::PaymentSendingFailed
Error::InvalidCustomTlv
})?;

match self.channel_manager.send_spontaneous_payment_with_retry(
Expand Down

0 comments on commit 4ca0953

Please sign in to comment.