Skip to content

Commit d4a0e9d

Browse files
committed
f Error variant updates
1 parent b058878 commit d4a0e9d

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

src/error.rs

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ use lightning::util::errors;
44
use lightning_invoice::payment;
55
use std::fmt;
66
use std::io;
7-
use std::sync::mpsc;
87
use std::time;
98

109
#[derive(Debug)]
@@ -21,6 +20,8 @@ pub enum LdkLiteError {
2120
FundingTxNotFinalized,
2221
/// A network connection has been closed.
2322
ConnectionFailed,
23+
/// Payment of the given invoice has already been intiated.
24+
NonUniquePaymentHash,
2425
/// A given peer info could not be parsed.
2526
PeerInfoParse(&'static str),
2627
/// A wrapped LDK `APIError`
@@ -41,8 +42,6 @@ pub enum LdkLiteError {
4142
StdIo(io::Error),
4243
/// A wrapped `SystemTimeError`
4344
StdTime(time::SystemTimeError),
44-
/// A wrapped `mpsc::RecvError`
45-
StdChannelRecv(mpsc::RecvError),
4645
}
4746

4847
impl fmt::Display for LdkLiteError {
@@ -53,6 +52,7 @@ impl fmt::Display for LdkLiteError {
5352
LdkLiteError::FundingTxNonWitnessOuputSpend => write!(f, "an input of the funding transaction tried spending a non-SegWit output, which is insecure"),
5453
LdkLiteError::FundingTxNotFinalized => write!(f, "the funding transaction could not be finalized"),
5554
LdkLiteError::ConnectionFailed => write!(f, "network connection closed"),
55+
LdkLiteError::NonUniquePaymentHash => write!(f, "an invoice must not get payed twice."),
5656
LdkLiteError::PeerInfoParse(ref e) => write!(f, "given peer info could not be parsed: {}", e),
5757
LdkLiteError::LdkDecode(ref e) => write!(f, "LDK decode error: {}", e),
5858
LdkLiteError::LdkApi(ref e) => write!(f, "LDK API error: {:?}", e),
@@ -63,7 +63,6 @@ impl fmt::Display for LdkLiteError {
6363
LdkLiteError::Bip32(ref e) => write!(f, "Bitcoin error: {}", e),
6464
LdkLiteError::StdIo(ref e) => write!(f, "IO error: {}", e),
6565
LdkLiteError::StdTime(ref e) => write!(f, "time error: {}", e),
66-
LdkLiteError::StdChannelRecv(ref e) => write!(f, "channel recv error: {}", e),
6766
}
6867
}
6968
}
@@ -122,12 +121,6 @@ impl From<time::SystemTimeError> for LdkLiteError {
122121
}
123122
}
124123

125-
impl From<mpsc::RecvError> for LdkLiteError {
126-
fn from(e: mpsc::RecvError) -> Self {
127-
Self::StdChannelRecv(e)
128-
}
129-
}
130-
131124
impl From<esplora::EsploraError> for LdkLiteError {
132125
fn from(e: esplora::EsploraError) -> Self {
133126
Self::Esplora(e)

0 commit comments

Comments
 (0)