Skip to content

Commit b7dec5c

Browse files
committed
ln/fix: invalid_onion_version code for DecodeError::UnknownVersion
Realm is no longer specified in BOLT04, use the specified version error instead.
1 parent 2d392f8 commit b7dec5c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lightning/src/ln/onion_utils.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2037,8 +2037,8 @@ fn decode_next_hop<T, R: ReadableArgs<T>, N: NextPacketBytes>(
20372037
match R::read(&mut chacha_stream, read_args) {
20382038
Err(err) => {
20392039
let error_code = match err {
2040-
// Unknown realm byte
2041-
msgs::DecodeError::UnknownVersion => 0x4000 | 1,
2040+
// Unknown version
2041+
msgs::DecodeError::UnknownVersion => 0x8000 | 0x4000 | 4,
20422042
// invalid_onion_payload
20432043
msgs::DecodeError::UnknownRequiredFeature
20442044
| msgs::DecodeError::InvalidValue

0 commit comments

Comments
 (0)