@@ -4,7 +4,6 @@ use lightning::util::errors;
4
4
use lightning_invoice:: payment;
5
5
use std:: fmt;
6
6
use std:: io;
7
- use std:: sync:: mpsc;
8
7
use std:: time;
9
8
10
9
#[ derive( Debug ) ]
@@ -21,6 +20,8 @@ pub enum LdkLiteError {
21
20
FundingTxNotFinalized ,
22
21
/// A network connection has been closed.
23
22
ConnectionFailed ,
23
+ /// Payment of the given invoice has already been intiated.
24
+ NonUniquePaymentHash ,
24
25
/// A given peer info could not be parsed.
25
26
PeerInfoParse ( & ' static str ) ,
26
27
/// A wrapped LDK `APIError`
@@ -41,8 +42,6 @@ pub enum LdkLiteError {
41
42
StdIo ( io:: Error ) ,
42
43
/// A wrapped `SystemTimeError`
43
44
StdTime ( time:: SystemTimeError ) ,
44
- /// A wrapped `mpsc::RecvError`
45
- StdChannelRecv ( mpsc:: RecvError ) ,
46
45
}
47
46
48
47
impl fmt:: Display for LdkLiteError {
@@ -53,6 +52,7 @@ impl fmt::Display for LdkLiteError {
53
52
LdkLiteError :: FundingTxNonWitnessOuputSpend => write ! ( f, "an input of the funding transaction tried spending a non-SegWit output, which is insecure" ) ,
54
53
LdkLiteError :: FundingTxNotFinalized => write ! ( f, "the funding transaction could not be finalized" ) ,
55
54
LdkLiteError :: ConnectionFailed => write ! ( f, "network connection closed" ) ,
55
+ LdkLiteError :: NonUniquePaymentHash => write ! ( f, "an invoice must not get payed twice." ) ,
56
56
LdkLiteError :: PeerInfoParse ( ref e) => write ! ( f, "given peer info could not be parsed: {}" , e) ,
57
57
LdkLiteError :: LdkDecode ( ref e) => write ! ( f, "LDK decode error: {}" , e) ,
58
58
LdkLiteError :: LdkApi ( ref e) => write ! ( f, "LDK API error: {:?}" , e) ,
@@ -63,7 +63,6 @@ impl fmt::Display for LdkLiteError {
63
63
LdkLiteError :: Bip32 ( ref e) => write ! ( f, "Bitcoin error: {}" , e) ,
64
64
LdkLiteError :: StdIo ( ref e) => write ! ( f, "IO error: {}" , e) ,
65
65
LdkLiteError :: StdTime ( ref e) => write ! ( f, "time error: {}" , e) ,
66
- LdkLiteError :: StdChannelRecv ( ref e) => write ! ( f, "channel recv error: {}" , e) ,
67
66
}
68
67
}
69
68
}
@@ -122,12 +121,6 @@ impl From<time::SystemTimeError> for LdkLiteError {
122
121
}
123
122
}
124
123
125
- impl From < mpsc:: RecvError > for LdkLiteError {
126
- fn from ( e : mpsc:: RecvError ) -> Self {
127
- Self :: StdChannelRecv ( e)
128
- }
129
- }
130
-
131
124
impl From < esplora:: EsploraError > for LdkLiteError {
132
125
fn from ( e : esplora:: EsploraError ) -> Self {
133
126
Self :: Esplora ( e)
0 commit comments