@@ -1547,8 +1547,7 @@ impl HTLCFailReason {
15471547 const NODE : u16 = 0x2000 ;
15481548 const UPDATE : u16 = 0x1000 ;
15491549
1550- if failure_code == 1 | PERM { debug_assert ! ( data. is_empty( ) ) }
1551- else if failure_code == 2 | NODE { debug_assert ! ( data. is_empty( ) ) }
1550+ if failure_code == 2 | NODE { debug_assert ! ( data. is_empty( ) ) }
15521551 else if failure_code == 2 | PERM | NODE { debug_assert ! ( data. is_empty( ) ) }
15531552 else if failure_code == 3 | PERM | NODE { debug_assert ! ( data. is_empty( ) ) }
15541553 else if failure_code == 4 | BADONION | PERM { debug_assert_eq ! ( data. len( ) , 32 ) }
@@ -1575,6 +1574,7 @@ impl HTLCFailReason {
15751574 else if failure_code == 21 { debug_assert ! ( data. is_empty( ) ) }
15761575 else if failure_code == 22 | PERM { debug_assert ! ( data. len( ) <= 11 ) }
15771576 else if failure_code == 23 { debug_assert ! ( data. is_empty( ) ) }
1577+ else if failure_code == INVALID_ONION_BLINDING { debug_assert_eq ! ( data. len( ) , 32 ) }
15781578 else if failure_code & BADONION != 0 {
15791579 // We set some bogus BADONION failure codes in test, so ignore unknown ones.
15801580 }
@@ -1975,7 +1975,7 @@ where
19751975 if hop_data. intro_node_blinding_point . is_some ( ) {
19761976 return Err ( OnionDecodeErr :: Relay {
19771977 err_msg : "Non-final intro node Trampoline onion data provided to us as last hop" ,
1978- err_code : INVALID_ONION_BLINDING ,
1978+ err_code : 0x4000 | 22 ,
19791979 shared_secret,
19801980 trampoline_shared_secret : Some ( SharedSecret :: from_bytes (
19811981 trampoline_shared_secret,
@@ -2175,8 +2175,8 @@ fn decode_next_hop<T, R: ReadableArgs<T>, N: NextPacketBytes>(
21752175 match R :: read ( & mut chacha_stream, read_args) {
21762176 Err ( err) => {
21772177 let error_code = match err {
2178- // Unknown realm byte
2179- msgs:: DecodeError :: UnknownVersion => 0x4000 | 1 ,
2178+ // Unknown version
2179+ msgs:: DecodeError :: UnknownVersion => 0x8000 | 0x4000 | 4 ,
21802180 // invalid_onion_payload
21812181 msgs:: DecodeError :: UnknownRequiredFeature
21822182 | msgs:: DecodeError :: InvalidValue
0 commit comments