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 {
86
86
"InvalidInvoice",
87
87
"InvalidChannelId",
88
88
"InvalidNetwork",
89
- "NonUniquePaymentHash ",
89
+ "DuplicatePayment ",
90
90
"InsufficientFunds",
91
91
};
92
92
Original file line number Diff line number Diff line change @@ -47,8 +47,8 @@ pub enum Error {
47
47
InvalidChannelId ,
48
48
/// The given network is invalid.
49
49
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 ,
52
52
/// There are insufficient funds to complete the given operation.
53
53
InsufficientFunds ,
54
54
}
@@ -80,7 +80,7 @@ impl fmt::Display for Error {
80
80
Self :: InvalidInvoice => write ! ( f, "The given invoice is invalid." ) ,
81
81
Self :: InvalidChannelId => write ! ( f, "The given channel ID is invalid." ) ,
82
82
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 ." ) ,
84
84
Self :: InsufficientFunds => {
85
85
write ! ( f, "There are insufficient funds to complete the given operation." )
86
86
}
Original file line number Diff line number Diff line change @@ -1145,7 +1145,7 @@ impl Node {
1145
1145
1146
1146
if self . payment_store . contains ( & payment_hash) {
1147
1147
log_error ! ( self . logger, "Payment error: an invoice must not get paid twice." ) ;
1148
- return Err ( Error :: NonUniquePaymentHash ) ;
1148
+ return Err ( Error :: DuplicatePayment ) ;
1149
1149
}
1150
1150
1151
1151
let payment_secret = Some ( * invoice. payment_secret ( ) ) ;
@@ -1220,7 +1220,7 @@ impl Node {
1220
1220
let payment_hash = PaymentHash ( ( * invoice. payment_hash ( ) ) . into_inner ( ) ) ;
1221
1221
if self . payment_store . contains ( & payment_hash) {
1222
1222
log_error ! ( self . logger, "Payment error: an invoice must not get paid twice." ) ;
1223
- return Err ( Error :: NonUniquePaymentHash ) ;
1223
+ return Err ( Error :: DuplicatePayment ) ;
1224
1224
}
1225
1225
1226
1226
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() {
122
122
assert_eq ! ( node_b. payment( & payment_hash) . unwrap( ) . amount_msat, Some ( invoice_amount_1_msat) ) ;
123
123
124
124
// 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) ) ;
126
126
127
127
// Test under-/overpayment
128
128
let invoice_amount_2_msat = 1000_000 ;
You can’t perform that action at this time.
0 commit comments