@@ -342,6 +342,8 @@ pub enum Event {
342
342
/// [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
343
343
/// [`ChannelManager::fail_htlc_backwards`]: crate::ln::channelmanager::ChannelManager::fail_htlc_backwards
344
344
PaymentReceived {
345
+ /// The received node, ie whether the node was a phantom node or not.
346
+ node_id : Option < PublicKey > ,
345
347
/// The hash for which the preimage should be handed to the ChannelManager. Note that LDK will
346
348
/// not stop you from registering duplicate payment hashes for inbound payments.
347
349
payment_hash : PaymentHash ,
@@ -366,6 +368,8 @@ pub enum Event {
366
368
///
367
369
/// [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
368
370
PaymentClaimed {
371
+ /// The received node, ie whether the node was a phantom node or not.
372
+ node_id : Option < PublicKey > ,
369
373
/// The payment hash of the claimed payment. Note that LDK will not stop you from
370
374
/// registering duplicate payment hashes for inbound payments.
371
375
payment_hash : PaymentHash ,
@@ -739,7 +743,7 @@ impl Writeable for Event {
739
743
// We never write out FundingGenerationReady events as, upon disconnection, peers
740
744
// drop any channels which have not yet exchanged funding_signed.
741
745
} ,
742
- & Event :: PaymentReceived { ref payment_hash, ref amount_msat, ref purpose } => {
746
+ & Event :: PaymentReceived { ref node_id , ref payment_hash, ref amount_msat, ref purpose } => {
743
747
1u8 . write ( writer) ?;
744
748
let mut payment_secret = None ;
745
749
let payment_preimage;
@@ -758,6 +762,7 @@ impl Writeable for Event {
758
762
( 4 , amount_msat, required) ,
759
763
( 6 , 0u64 , required) , // user_payment_id required for compatibility with 0.0.103 and earlier
760
764
( 8 , payment_preimage, option) ,
765
+ ( 10 , node_id, required) ,
761
766
} ) ;
762
767
} ,
763
768
& Event :: PaymentSent { ref payment_id, ref payment_preimage, ref payment_hash, ref fee_paid_msat } => {
@@ -854,12 +859,13 @@ impl Writeable for Event {
854
859
// We never write the OpenChannelRequest events as, upon disconnection, peers
855
860
// drop any channels which have not yet exchanged funding_signed.
856
861
} ,
857
- & Event :: PaymentClaimed { ref payment_hash, ref amount_msat, ref purpose } => {
862
+ & Event :: PaymentClaimed { ref node_id , ref payment_hash, ref amount_msat, ref purpose } => {
858
863
19u8 . write ( writer) ?;
859
864
write_tlv_fields ! ( writer, {
860
865
( 0 , payment_hash, required) ,
861
866
( 2 , purpose, required) ,
862
867
( 4 , amount_msat, required) ,
868
+ ( 6 , node_id, required) ,
863
869
} ) ;
864
870
} ,
865
871
& Event :: ProbeSuccessful { ref payment_id, ref payment_hash, ref path } => {
@@ -923,13 +929,15 @@ impl MaybeReadable for Event {
923
929
let mut payment_preimage = None ;
924
930
let mut payment_secret = None ;
925
931
let mut amount_msat = 0 ;
932
+ let mut node_id = None ;
926
933
let mut _user_payment_id = None :: < u64 > ; // For compatibility with 0.0.103 and earlier
927
934
read_tlv_fields ! ( reader, {
928
935
( 0 , payment_hash, required) ,
929
936
( 2 , payment_secret, option) ,
930
937
( 4 , amount_msat, required) ,
931
938
( 6 , _user_payment_id, option) ,
932
939
( 8 , payment_preimage, option) ,
940
+ ( 10 , node_id, required) ,
933
941
} ) ;
934
942
let purpose = match payment_secret {
935
943
Some ( secret) => PaymentPurpose :: InvoicePayment {
@@ -940,6 +948,7 @@ impl MaybeReadable for Event {
940
948
None => return Err ( msgs:: DecodeError :: InvalidValue ) ,
941
949
} ;
942
950
Ok ( Some ( Event :: PaymentReceived {
951
+ node_id,
943
952
payment_hash,
944
953
amount_msat,
945
954
purpose,
@@ -1117,13 +1126,17 @@ impl MaybeReadable for Event {
1117
1126
let mut payment_hash = PaymentHash ( [ 0 ; 32 ] ) ;
1118
1127
let mut purpose = None ;
1119
1128
let mut amount_msat = 0 ;
1129
+ let mut node_id = None ;
1120
1130
read_tlv_fields ! ( reader, {
1121
1131
( 0 , payment_hash, required) ,
1122
1132
( 2 , purpose, ignorable) ,
1123
1133
( 4 , amount_msat, required) ,
1134
+ ( 6 , node_id, required) ,
1124
1135
} ) ;
1125
1136
if purpose. is_none ( ) { return Ok ( None ) ; }
1137
+
1126
1138
Ok ( Some ( Event :: PaymentClaimed {
1139
+ node_id,
1127
1140
payment_hash,
1128
1141
purpose : purpose. unwrap ( ) ,
1129
1142
amount_msat,
0 commit comments