@@ -1417,14 +1417,6 @@ impl Writeable for OnionHopData {
1417
1417
}
1418
1418
}
1419
1419
1420
- // ReadableArgs because we need onion_utils::decode_next_hop to accommodate payment packets and
1421
- // onion message packets.
1422
- impl ReadableArgs < ( ) > for OnionHopData {
1423
- fn read < R : Read > ( r : & mut R , _arg : ( ) ) -> Result < Self , DecodeError > {
1424
- <Self as Readable >:: read ( r)
1425
- }
1426
- }
1427
-
1428
1420
impl Readable for OnionHopData {
1429
1421
fn read < R : Read > ( mut r : & mut R ) -> Result < Self , DecodeError > {
1430
1422
use bitcoin:: consensus:: encode:: { Decodable , Error , VarInt } ;
@@ -1441,12 +1433,12 @@ impl Readable for OnionHopData {
1441
1433
let mut short_id: Option < u64 > = None ;
1442
1434
let mut payment_data: Option < FinalOnionHopData > = None ;
1443
1435
let mut keysend_preimage: Option < PaymentPreimage > = None ;
1444
- // The TLV type is chosen to be compatible with lnd and c-lightning.
1445
1436
decode_tlv_stream ! ( & mut rd, {
1446
1437
( 2 , amt, required) ,
1447
1438
( 4 , cltv_value, required) ,
1448
1439
( 6 , short_id, option) ,
1449
1440
( 8 , payment_data, option) ,
1441
+ // See https://github.com/lightning/blips/blob/master/blip-0003.md
1450
1442
( 5482373484 , keysend_preimage, option)
1451
1443
} ) ;
1452
1444
rd. eat_remaining ( ) . map_err ( |_| DecodeError :: ShortRead ) ?;
@@ -1488,6 +1480,14 @@ impl Readable for OnionHopData {
1488
1480
}
1489
1481
}
1490
1482
1483
+ // ReadableArgs because we need onion_utils::decode_next_hop to accommodate payment packets and
1484
+ // onion message packets.
1485
+ impl ReadableArgs < ( ) > for OnionHopData {
1486
+ fn read < R : Read > ( r : & mut R , _arg : ( ) ) -> Result < Self , DecodeError > {
1487
+ <Self as Readable >:: read ( r)
1488
+ }
1489
+ }
1490
+
1491
1491
impl Writeable for Ping {
1492
1492
fn write < W : Writer > ( & self , w : & mut W ) -> Result < ( ) , io:: Error > {
1493
1493
self . ponglen . write ( w) ?;
0 commit comments