@@ -342,6 +342,12 @@ pub enum Event {
342342/// [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds 
343343/// [`ChannelManager::fail_htlc_backwards`]: crate::ln::channelmanager::ChannelManager::fail_htlc_backwards 
344344PaymentReceived  { 
345+ 		/// The node that received the payment. 
346+ /// This is useful to identify payments which were received via [phantom node payments]. 
347+ /// This field will always be filled in when the event was generated by LDK versions 0.0.113 and above. 
348+ ///  
349+ /// [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager 
350+ receiver_node_id :  Option < PublicKey > , 
345351		/// The hash for which the preimage should be handed to the ChannelManager. Note that LDK will 
346352/// not stop you from registering duplicate payment hashes for inbound payments. 
347353payment_hash :  PaymentHash , 
@@ -366,6 +372,12 @@ pub enum Event {
366372/// 
367373/// [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds 
368374PaymentClaimed  { 
375+ 		/// The node that received the payment. 
376+ /// This is useful to identify payments which were received via [phantom node payments]. 
377+ /// This field will always be filled in when the event was generated by LDK versions 0.0.113 and above. 
378+ ///  
379+ /// [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager 
380+ receiver_node_id :  Option < PublicKey > , 
369381		/// The payment hash of the claimed payment. Note that LDK will not stop you from 
370382/// registering duplicate payment hashes for inbound payments. 
371383payment_hash :  PaymentHash , 
@@ -739,7 +751,7 @@ impl Writeable for Event {
739751				// We never write out FundingGenerationReady events as, upon disconnection, peers 
740752				// drop any channels which have not yet exchanged funding_signed. 
741753			} , 
742- 			& Event :: PaymentReceived  {  ref  payment_hash,  ref  amount_msat,  ref  purpose }  => { 
754+ 			& Event :: PaymentReceived  {  ref  payment_hash,  ref  amount_msat,  ref  purpose,   ref  receiver_node_id  }  => { 
743755				1u8 . write ( writer) ?; 
744756				let  mut  payment_secret = None ; 
745757				let  payment_preimage; 
@@ -754,6 +766,7 @@ impl Writeable for Event {
754766				} 
755767				write_tlv_fields ! ( writer,  { 
756768					( 0 ,  payment_hash,  required) , 
769+ 					( 1 ,  receiver_node_id,  option) , 
757770					( 2 ,  payment_secret,  option) , 
758771					( 4 ,  amount_msat,  required) , 
759772					( 6 ,  0u64 ,  required) ,  // user_payment_id required for compatibility with 0.0.103 and earlier 
@@ -854,10 +867,11 @@ impl Writeable for Event {
854867				// We never write the OpenChannelRequest events as, upon disconnection, peers 
855868				// drop any channels which have not yet exchanged funding_signed. 
856869			} , 
857- 			& Event :: PaymentClaimed  {  ref  payment_hash,  ref  amount_msat,  ref  purpose }  => { 
870+ 			& Event :: PaymentClaimed  {  ref  payment_hash,  ref  amount_msat,  ref  purpose,   ref  receiver_node_id  }  => { 
858871				19u8 . write ( writer) ?; 
859872				write_tlv_fields ! ( writer,  { 
860873					( 0 ,  payment_hash,  required) , 
874+ 					( 1 ,  receiver_node_id,  option) , 
861875					( 2 ,  purpose,  required) , 
862876					( 4 ,  amount_msat,  required) , 
863877				} ) ; 
@@ -923,9 +937,11 @@ impl MaybeReadable for Event {
923937					let  mut  payment_preimage = None ; 
924938					let  mut  payment_secret = None ; 
925939					let  mut  amount_msat = 0 ; 
940+ 					let  mut  receiver_node_id = None ; 
926941					let  mut  _user_payment_id = None :: < u64 > ;  // For compatibility with 0.0.103 and earlier 
927942					read_tlv_fields ! ( reader,  { 
928943						( 0 ,  payment_hash,  required) , 
944+ 						( 1 ,  receiver_node_id,  option) , 
929945						( 2 ,  payment_secret,  option) , 
930946						( 4 ,  amount_msat,  required) , 
931947						( 6 ,  _user_payment_id,  option) , 
@@ -940,6 +956,7 @@ impl MaybeReadable for Event {
940956						None  => return  Err ( msgs:: DecodeError :: InvalidValue ) , 
941957					} ; 
942958					Ok ( Some ( Event :: PaymentReceived  { 
959+ 						receiver_node_id, 
943960						payment_hash, 
944961						amount_msat, 
945962						purpose, 
@@ -1117,13 +1134,16 @@ impl MaybeReadable for Event {
11171134					let  mut  payment_hash = PaymentHash ( [ 0 ;  32 ] ) ; 
11181135					let  mut  purpose = None ; 
11191136					let  mut  amount_msat = 0 ; 
1137+ 					let  mut  receiver_node_id = None ; 
11201138					read_tlv_fields ! ( reader,  { 
11211139						( 0 ,  payment_hash,  required) , 
1140+ 						( 1 ,  receiver_node_id,  option) , 
11221141						( 2 ,  purpose,  ignorable) , 
11231142						( 4 ,  amount_msat,  required) , 
11241143					} ) ; 
11251144					if  purpose. is_none ( )  {  return  Ok ( None ) ;  } 
11261145					Ok ( Some ( Event :: PaymentClaimed  { 
1146+ 						receiver_node_id, 
11271147						payment_hash, 
11281148						purpose :  purpose. unwrap ( ) , 
11291149						amount_msat, 
0 commit comments