You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
we need this for deserializing various old objects, eg if we decided
to fail an htlc on a previous version, stored that that htlc is
pending-failure and then shut down and upgraded.
let payloads = &encrypted_packet.attribution_data[..MAX_HOPS*PAYLOAD_LEN];
1081
-
let hmacs = &encrypted_packet.attribution_data[MAX_HOPS*PAYLOAD_LEN..];
1080
+
let payloads = &encrypted_packet.attribution_data.as_ref().unwrap()[..MAX_HOPS*PAYLOAD_LEN];// XXX: This will break if we get an err from an unupgraded node
1081
+
let hmacs = &encrypted_packet.attribution_data.as_ref().unwrap()[MAX_HOPS*PAYLOAD_LEN..];// XXX: This will break if we get an err from an unupgraded node
1082
1082
1083
1083
let um = gen_um_from_shared_secret(shared_secret.as_ref());
1084
1084
letmut hmac = HmacEngine::<Sha256>::new(&um);
@@ -1108,11 +1108,11 @@ where
1108
1108
}
1109
1109
1110
1110
// Shift payloads left.
1111
-
let payloads = &mut encrypted_packet.attribution_data[..MAX_HOPS*PAYLOAD_LEN];
1111
+
let payloads = &mut encrypted_packet.attribution_data.as_mut().unwrap()[..MAX_HOPS*PAYLOAD_LEN];// XXX: This will break if we get an err from an unupgraded node
1112
1112
payloads.copy_within(PAYLOAD_LEN..,0);
1113
1113
1114
1114
// Shift hmacs left.
1115
-
let hmacs = &mut encrypted_packet.attribution_data[MAX_HOPS*PAYLOAD_LEN..];
1115
+
let hmacs = &mut encrypted_packet.attribution_data.as_mut().unwrap()[MAX_HOPS*PAYLOAD_LEN..];// XXX: This will break if we get an err from an unupgraded node
let payloads = &onion_error.attribution_data[..MAX_HOPS*PAYLOAD_LEN];
1925
+
let payloads = &onion_error.attribution_data.as_ref().unwrap()[..MAX_HOPS*PAYLOAD_LEN];// XXX: This will break if we get an err from an unupgraded node
0 commit comments