@@ -249,8 +249,8 @@ pub enum Event {
249249 /// [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
250250 /// [`ChannelManager::fail_htlc_backwards`]: crate::ln::channelmanager::ChannelManager::fail_htlc_backwards
251251 PaymentReceived {
252- /// The received node, ie whether the node was a phantom node or not.
253- node_id : Option < PublicKey > ,
252+ /// The node that recieved the payment, ie our node
253+ our_node_id : Option < PublicKey > ,
254254 /// The hash for which the preimage should be handed to the ChannelManager. Note that LDK will
255255 /// not stop you from registering duplicate payment hashes for inbound payments.
256256 payment_hash : PaymentHash ,
@@ -275,8 +275,8 @@ pub enum Event {
275275 ///
276276 /// [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
277277 PaymentClaimed {
278- /// The received node, ie whether the node was a phantom node or not.
279- node_id : Option < PublicKey > ,
278+ /// The node that recieved the payment, ie our node
279+ our_node_id : Option < PublicKey > ,
280280 /// The payment hash of the claimed payment. Note that LDK will not stop you from
281281 /// registering duplicate payment hashes for inbound payments.
282282 payment_hash : PaymentHash ,
@@ -616,7 +616,7 @@ impl Writeable for Event {
616616 // We never write out FundingGenerationReady events as, upon disconnection, peers
617617 // drop any channels which have not yet exchanged funding_signed.
618618 } ,
619- & Event :: PaymentReceived { ref node_id , ref payment_hash, ref amount_msat, ref purpose } => {
619+ & Event :: PaymentReceived { ref payment_hash, ref amount_msat, ref purpose, our_node_id } => {
620620 1u8 . write ( writer) ?;
621621 let mut payment_secret = None ;
622622 let payment_preimage;
@@ -635,7 +635,7 @@ impl Writeable for Event {
635635 ( 4 , amount_msat, required) ,
636636 ( 6 , 0u64 , required) , // user_payment_id required for compatibility with 0.0.103 and earlier
637637 ( 8 , payment_preimage, option) ,
638- ( 10 , node_id , required ) ,
638+ ( 10 , our_node_id , option ) ,
639639 } ) ;
640640 } ,
641641 & Event :: PaymentSent { ref payment_id, ref payment_preimage, ref payment_hash, ref fee_paid_msat } => {
@@ -726,13 +726,13 @@ impl Writeable for Event {
726726 // We never write the OpenChannelRequest events as, upon disconnection, peers
727727 // drop any channels which have not yet exchanged funding_signed.
728728 } ,
729- & Event :: PaymentClaimed { ref node_id , ref payment_hash, ref amount_msat, ref purpose } => {
729+ & Event :: PaymentClaimed { ref payment_hash, ref amount_msat, ref purpose, our_node_id } => {
730730 19u8 . write ( writer) ?;
731731 write_tlv_fields ! ( writer, {
732732 ( 0 , payment_hash, required) ,
733733 ( 2 , purpose, required) ,
734734 ( 4 , amount_msat, required) ,
735- ( 6 , node_id , required ) ,
735+ ( 6 , our_node_id , option ) ,
736736 } ) ;
737737 } ,
738738 & Event :: ProbeSuccessful { ref payment_id, ref payment_hash, ref path } => {
@@ -778,15 +778,15 @@ impl MaybeReadable for Event {
778778 let mut payment_preimage = None ;
779779 let mut payment_secret = None ;
780780 let mut amount_msat = 0 ;
781- let mut node_id = None ;
781+ let mut our_node_id = None ;
782782 let mut _user_payment_id = None :: < u64 > ; // For compatibility with 0.0.103 and earlier
783783 read_tlv_fields ! ( reader, {
784784 ( 0 , payment_hash, required) ,
785785 ( 2 , payment_secret, option) ,
786786 ( 4 , amount_msat, required) ,
787787 ( 6 , _user_payment_id, option) ,
788788 ( 8 , payment_preimage, option) ,
789- ( 10 , node_id , required ) ,
789+ ( 10 , our_node_id , option ) ,
790790 } ) ;
791791 let purpose = match payment_secret {
792792 Some ( secret) => PaymentPurpose :: InvoicePayment {
@@ -797,7 +797,7 @@ impl MaybeReadable for Event {
797797 None => return Err ( msgs:: DecodeError :: InvalidValue ) ,
798798 } ;
799799 Ok ( Some ( Event :: PaymentReceived {
800- node_id ,
800+ our_node_id ,
801801 payment_hash,
802802 amount_msat,
803803 purpose,
@@ -967,17 +967,17 @@ impl MaybeReadable for Event {
967967 let mut payment_hash = PaymentHash ( [ 0 ; 32 ] ) ;
968968 let mut purpose = None ;
969969 let mut amount_msat = 0 ;
970- let mut node_id = None ;
970+ let mut our_node_id = None ;
971971 read_tlv_fields ! ( reader, {
972972 ( 0 , payment_hash, required) ,
973973 ( 2 , purpose, ignorable) ,
974974 ( 4 , amount_msat, required) ,
975- ( 6 , node_id , required ) ,
975+ ( 6 , our_node_id , option ) ,
976976 } ) ;
977977 if purpose. is_none ( ) { return Ok ( None ) ; }
978978
979979 Ok ( Some ( Event :: PaymentClaimed {
980- node_id ,
980+ our_node_id ,
981981 payment_hash,
982982 purpose : purpose. unwrap ( ) ,
983983 amount_msat,
0 commit comments