@@ -1547,8 +1547,7 @@ impl HTLCFailReason {
1547
1547
const NODE : u16 = 0x2000 ;
1548
1548
const UPDATE : u16 = 0x1000 ;
1549
1549
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( ) ) }
1552
1551
else if failure_code == 2 | PERM | NODE { debug_assert ! ( data. is_empty( ) ) }
1553
1552
else if failure_code == 3 | PERM | NODE { debug_assert ! ( data. is_empty( ) ) }
1554
1553
else if failure_code == 4 | BADONION | PERM { debug_assert_eq ! ( data. len( ) , 32 ) }
@@ -1575,6 +1574,7 @@ impl HTLCFailReason {
1575
1574
else if failure_code == 21 { debug_assert ! ( data. is_empty( ) ) }
1576
1575
else if failure_code == 22 | PERM { debug_assert ! ( data. len( ) <= 11 ) }
1577
1576
else if failure_code == 23 { debug_assert ! ( data. is_empty( ) ) }
1577
+ else if failure_code == INVALID_ONION_BLINDING { debug_assert_eq ! ( data. len( ) , 32 ) }
1578
1578
else if failure_code & BADONION != 0 {
1579
1579
// We set some bogus BADONION failure codes in test, so ignore unknown ones.
1580
1580
}
@@ -1975,7 +1975,7 @@ where
1975
1975
if hop_data. intro_node_blinding_point . is_some ( ) {
1976
1976
return Err ( OnionDecodeErr :: Relay {
1977
1977
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 ,
1979
1979
shared_secret,
1980
1980
trampoline_shared_secret : Some ( SharedSecret :: from_bytes (
1981
1981
trampoline_shared_secret,
@@ -2175,8 +2175,8 @@ fn decode_next_hop<T, R: ReadableArgs<T>, N: NextPacketBytes>(
2175
2175
match R :: read ( & mut chacha_stream, read_args) {
2176
2176
Err ( err) => {
2177
2177
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 ,
2180
2180
// invalid_onion_payload
2181
2181
msgs:: DecodeError :: UnknownRequiredFeature
2182
2182
| msgs:: DecodeError :: InvalidValue
0 commit comments