mirror of
https://github.com/lightningdevkit/rust-lightning.git
synced 2025-02-24 15:02:20 +01:00
[invoice] Ignore InvalidLength fields
BOLT 11 states that a reader "MUST skip over...`p`, `h`, `s` or `n` fields that do NOT have data_lengths of 52, 52, 52 or 53, respectively." Here we do so by simply ignoring any invalid-length field.
This commit is contained in:
parent
75f7af64f3
commit
c7cf5011be
1 changed files with 1 additions and 1 deletions
|
@ -419,7 +419,7 @@ fn parse_tagged_parts(data: &[u5]) -> Result<Vec<RawTaggedField>, ParseError> {
|
|||
Ok(field) => {
|
||||
parts.push(RawTaggedField::KnownSemantics(field))
|
||||
},
|
||||
Err(ParseError::Skip) => {
|
||||
Err(ParseError::Skip)|Err(ParseError::Bech32Error(bech32::Error::InvalidLength)) => {
|
||||
parts.push(RawTaggedField::UnknownSemantics(field.into()))
|
||||
},
|
||||
Err(e) => {return Err(e)}
|
||||
|
|
Loading…
Add table
Reference in a new issue