pub enum PolicyError {
Show 14 variants
ToSelfDelayUnreasonablyLarge {
proposed: u16,
allowed_maximum: u16,
},
MaxAcceptedHtlcLimitExceeded(u16),
FeeRateUnreasonable {
proposed: u32,
lowest_accepted: u32,
highest_accepted: u32,
},
ChannelReserveLessDust {
reserve: u64,
dust_limit: u64,
},
DustLimitTooSmall(u64),
ChannelFundingTooSmall {
proposed: u64,
required_minimum: u64,
},
HtlcMinimumTooLarge {
proposed: u64,
allowed_maximum: u64,
},
HtlcInFlightMaximumTooSmall {
proposed: u64,
required_minimum: u64,
},
ChannelReserveTooLarge {
proposed: u64,
allowed_maximum: u64,
},
MaxAcceptedHtlcsTooSmall {
proposed: u16,
required_minimum: u16,
},
DustLimitTooLarge {
proposed: u64,
allowed_maximum: u64,
},
UnreasonableMinDepth {
proposed: u32,
allowed_maximum: u32,
},
LocalDustExceedsRemoteReserve {
channel_reserve: u64,
dust_limit: u64,
},
RemoteDustExceedsLocalReserve {
channel_reserve: u64,
dust_limit: u64,
},
}
Expand description
Errors from BOLT-2 policy validations for open_channel
and
accept_channel
messages.
Variants§
ToSelfDelayUnreasonablyLarge
proposed to_self_delay
value {proposed} is unreasonably large and
exceeds node policy limit of {allowed_maximum}; rejecting the channel
according to BOLT-2
MaxAcceptedHtlcLimitExceeded(u16)
proposed limit for maximum accepted number of HTLCs {0} exceeds BOLT-3 requirement to be below 483; rejecting the channel according to BOLT-2
FeeRateUnreasonable
proposed fee rate {proposed} sat/kw is outside of the fee rate policy of the local node ({lowest_accepted}..{highest_accepted} sat/kw); rejecting the channel according to BOLT-2
ChannelReserveLessDust
proposed channel reserve limit {reserve} sat is less than dust limit {dust_limit} sat; rejecting the channel according to BOLT-2
DustLimitTooSmall(u64)
dust limit {0} sat is less than protocol minimum requirement of 354 sat; rejecting the channel according to BOLT-2
ChannelFundingTooSmall
offered channel funding of {proposed} sat is too small and less than {required_minimum} required by the node policy; rejecting the channel according to BOLT-2
HtlcMinimumTooLarge
HTLC minimum {proposed} is too large and exceeds node policy requirements ({allowed_maximum}); rejecting the channel according to BOLT-2
HtlcInFlightMaximumTooSmall
HTLC-in-flight maximum requirement of {proposed} is too small and does not match the node policy; the smallest requirement is {required_minimum}; rejecting the channel according to BOLT-2
ChannelReserveTooLarge
requested {proposed} channel reserve is too large and exceeds local policy requirement of {allowed_maximum}; rejecting the channel according to BOLT-2
MaxAcceptedHtlcsTooSmall
maximum number of HTLCs {proposed} that can be accepted by the remote node is too small and does not match node policy requirement of {required_minimum}; rejecting the channel according to BOLT-2
DustLimitTooLarge
dust limit {proposed} sats exceeds node policy requirement of {allowed_maximum}; rejecting the channel according to BOLT-2
UnreasonableMinDepth
minimum depth of {proposed} requested by the remote peer is exceeds local policy limit of {allowed_maximum}; rejecting the channel according to BOLT-2
LocalDustExceedsRemoteReserve
channel_reserve_satoshis
({channel_reserve}) is less than
dust_limit_satoshis
({dust_limit}) within the open_channel
message; rejecting the channel according to BOLT-2
RemoteDustExceedsLocalReserve
channel_reserve_satoshis
from the open_channel message
({channel_reserve}) is less than dust_limit_satoshis
({dust_limit}; rejecting the channel according to BOLT-2
Trait Implementations§
Source§impl Clone for PolicyError
impl Clone for PolicyError
Source§fn clone(&self) -> PolicyError
fn clone(&self) -> PolicyError
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for PolicyError
impl Debug for PolicyError
Source§impl Display for PolicyError
impl Display for PolicyError
Source§impl Error for PolicyError
impl Error for PolicyError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§impl From<PolicyError> for Error
impl From<PolicyError> for Error
Source§fn from(v: PolicyError) -> Self
fn from(v: PolicyError) -> Self
Source§impl From<PolicyError> for String
impl From<PolicyError> for String
Source§fn from(err: PolicyError) -> Self
fn from(err: PolicyError) -> Self
Source§impl Hash for PolicyError
impl Hash for PolicyError
Source§impl PartialEq for PolicyError
impl PartialEq for PolicyError
Source§impl StrictDecode for PolicyError
impl StrictDecode for PolicyError
Source§fn strict_decode<D: Read>(d: D) -> Result<Self, Error>
fn strict_decode<D: Read>(d: D) -> Result<Self, Error>
std::io::Read
instance; must either
construct an instance or return implementation-specific error type.Source§fn strict_deserialize(data: impl AsRef<[u8]>) -> Result<Self, Error>
fn strict_deserialize(data: impl AsRef<[u8]>) -> Result<Self, Error>
StrictDecode::strict_decode
. If there are some data remains in the
buffer once deserialization is completed, fails with
Error::DataNotEntirelyConsumed
. Use io::Cursor
over the buffer and
StrictDecode::strict_decode
to avoid such failures.Source§fn strict_file_load(path: impl AsRef<Path>) -> Result<Self, Error>
fn strict_file_load(path: impl AsRef<Path>) -> Result<Self, Error>
path
and reconstructs object from it. Fails
with Error::DataNotEntirelyConsumed
if file contains remaining
data after the object reconstruction.Source§impl StrictEncode for PolicyError
impl StrictEncode for PolicyError
Source§fn strict_encode<E: Write>(&self, e: E) -> Result<usize, Error>
fn strict_encode<E: Write>(&self, e: E) -> Result<usize, Error>
std::io::Write
instance; must return result
with either amount of bytes encoded – or implementation-specific
error type.Source§fn strict_serialize(&self) -> Result<Vec<u8>, Error>
fn strict_serialize(&self) -> Result<Vec<u8>, Error>
StrictEncode::strict_encode
functionimpl Copy for PolicyError
impl Eq for PolicyError
impl StructuralPartialEq for PolicyError
Auto Trait Implementations§
impl Freeze for PolicyError
impl RefUnwindSafe for PolicyError
impl Send for PolicyError
impl Sync for PolicyError
impl Unpin for PolicyError
impl UnwindSafe for PolicyError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.