expose more granular data in TaggedHash struct
[rust-lightning] / lightning / src / offers / parse.rs
index b722499f251ad5213e1d27bbdb613da2c6aba2f7..c85c2f326b02a816dd85ba285334112ad557c324 100644 (file)
@@ -116,7 +116,7 @@ impl<T: SeekReadable> TryFrom<Vec<u8>> for ParsedMessage<T> {
 }
 
 /// Error when parsing a bech32 encoded message using [`str::parse`].
-#[derive(Debug, PartialEq)]
+#[derive(Clone, Debug, PartialEq)]
 pub enum Bolt12ParseError {
        /// The bech32 encoding does not conform to the BOLT 12 requirements for continuing messages
        /// across multiple parts (i.e., '+' followed by whitespace).
@@ -135,7 +135,7 @@ pub enum Bolt12ParseError {
 }
 
 /// Error when interpreting a TLV stream as a specific type.
-#[derive(Debug, PartialEq)]
+#[derive(Clone, Debug, PartialEq)]
 pub enum Bolt12SemanticError {
        /// The current [`std::time::SystemTime`] is past the offer or invoice's expiration.
        AlreadyExpired,
@@ -179,6 +179,8 @@ pub enum Bolt12SemanticError {
        MissingPayerMetadata,
        /// A payer id was expected but was missing.
        MissingPayerId,
+       /// The payment id for a refund or request is already in use.
+       DuplicatePaymentId,
        /// Blinded paths were expected but were missing.
        MissingPaths,
        /// The blinded payinfo given does not match the number of blinded path hops.