Fix panic on pathfinding to blinded recipient
authorValentine Wallace <vwallace@protonmail.com>
Tue, 9 May 2023 18:26:10 +0000 (14:26 -0400)
committerValentine Wallace <vwallace@protonmail.com>
Mon, 12 Jun 2023 21:27:03 +0000 (17:27 -0400)
The previous dummy payee id was an invalid pubkey

lightning/src/routing/router.rs

index f7ed173b901a90a9dbe0d81166dfb188b77ccec9..30b1f8f1ca82e94b2327e3c0777e58594ba9ad76 100644 (file)
@@ -1295,7 +1295,7 @@ where L::Target: Logger {
        // unblinded payee id as an option. We also need a non-optional "payee id" for path construction,
        // so use a dummy id for this in the blinded case.
        let payee_node_id_opt = payment_params.payee.node_id().map(|pk| NodeId::from_pubkey(&pk));
-       const DUMMY_BLINDED_PAYEE_ID: [u8; 33] = [42u8; 33];
+       const DUMMY_BLINDED_PAYEE_ID: [u8; 33] = [2; 33];
        let maybe_dummy_payee_pk = payment_params.payee.node_id().unwrap_or_else(|| PublicKey::from_slice(&DUMMY_BLINDED_PAYEE_ID).unwrap());
        let maybe_dummy_payee_node_id = NodeId::from_pubkey(&maybe_dummy_payee_pk);
        let our_node_id = NodeId::from_pubkey(&our_node_pubkey);