File tree Expand file tree Collapse file tree 4 files changed +7
-7
lines changed
Expand file tree Collapse file tree 4 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ enum NodeError {
8686 "InvalidInvoice",
8787 "InvalidChannelId",
8888 "InvalidNetwork",
89- "NonUniquePaymentHash ",
89+ "DuplicatePayment ",
9090 "InsufficientFunds",
9191};
9292
Original file line number Diff line number Diff line change @@ -47,8 +47,8 @@ pub enum Error {
4747 InvalidChannelId ,
4848 /// The given network is invalid.
4949 InvalidNetwork ,
50- /// Payment of the given invoice has already been intiated.
51- NonUniquePaymentHash ,
50+ /// A payment with the given hash has already been intiated.
51+ DuplicatePayment ,
5252 /// There are insufficient funds to complete the given operation.
5353 InsufficientFunds ,
5454}
@@ -80,7 +80,7 @@ impl fmt::Display for Error {
8080 Self :: InvalidInvoice => write ! ( f, "The given invoice is invalid." ) ,
8181 Self :: InvalidChannelId => write ! ( f, "The given channel ID is invalid." ) ,
8282 Self :: InvalidNetwork => write ! ( f, "The given network is invalid." ) ,
83- Self :: NonUniquePaymentHash => write ! ( f, "An invoice must not get payed twice ." ) ,
83+ Self :: DuplicatePayment => write ! ( f, "A payment with the given hash has already been initiated ." ) ,
8484 Self :: InsufficientFunds => {
8585 write ! ( f, "There are insufficient funds to complete the given operation." )
8686 }
Original file line number Diff line number Diff line change @@ -1145,7 +1145,7 @@ impl Node {
11451145
11461146 if self . payment_store . contains ( & payment_hash) {
11471147 log_error ! ( self . logger, "Payment error: an invoice must not get paid twice." ) ;
1148- return Err ( Error :: NonUniquePaymentHash ) ;
1148+ return Err ( Error :: DuplicatePayment ) ;
11491149 }
11501150
11511151 let payment_secret = Some ( * invoice. payment_secret ( ) ) ;
@@ -1220,7 +1220,7 @@ impl Node {
12201220 let payment_hash = PaymentHash ( ( * invoice. payment_hash ( ) ) . into_inner ( ) ) ;
12211221 if self . payment_store . contains ( & payment_hash) {
12221222 log_error ! ( self . logger, "Payment error: an invoice must not get paid twice." ) ;
1223- return Err ( Error :: NonUniquePaymentHash ) ;
1223+ return Err ( Error :: DuplicatePayment ) ;
12241224 }
12251225
12261226 let payment_id = PaymentId ( invoice. payment_hash ( ) . into_inner ( ) ) ;
Original file line number Diff line number Diff line change @@ -122,7 +122,7 @@ fn channel_full_cycle() {
122122 assert_eq ! ( node_b. payment( & payment_hash) . unwrap( ) . amount_msat, Some ( invoice_amount_1_msat) ) ;
123123
124124 // Assert we fail duplicate outbound payments.
125- assert_eq ! ( Err ( Error :: NonUniquePaymentHash ) , node_a. send_payment( & invoice) ) ;
125+ assert_eq ! ( Err ( Error :: DuplicatePayment ) , node_a. send_payment( & invoice) ) ;
126126
127127 // Test under-/overpayment
128128 let invoice_amount_2_msat = 1000_000 ;
You can’t perform that action at this time.
0 commit comments