pub struct TlcErrPacket {
pub onion_packet: Vec<u8>,
}Expand description
An encrypted error packet for TLC failures. The sender should decode it and then decide what to do with the error. Note: this is supposed to be only accessible by the sender, and it’s not reliable since it is not placed on-chain due to the possibility of hop failure.
Fields§
§onion_packet: Vec<u8>Implementations§
Source§impl TlcErrPacket
impl TlcErrPacket
Sourcepub fn from_payload(payload: Vec<u8>, shared_secret: &[u8; 32]) -> Self
pub fn from_payload(payload: Vec<u8>, shared_secret: &[u8; 32]) -> Self
Create a new TlcErrPacket from raw payload bytes. Erring node creates the error packet using the shared secret used in forwarding onion packet. Use all zeros (NO_SHARED_SECRET) for the origin node.
Sourcepub fn is_plaintext(&self) -> bool
pub fn is_plaintext(&self) -> bool
Check if this packet is plaintext (not encrypted).
Trait Implementations§
Source§impl Clone for TlcErrPacket
impl Clone for TlcErrPacket
Source§fn clone(&self) -> TlcErrPacket
fn clone(&self) -> TlcErrPacket
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TlcErrPacket
impl Debug for TlcErrPacket
Source§impl<'de> Deserialize<'de> for TlcErrPacket
impl<'de> Deserialize<'de> for TlcErrPacket
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for TlcErrPacket
impl Display for TlcErrPacket
Source§impl From<TlcErrPacket> for TlcErrPacket
impl From<TlcErrPacket> for TlcErrPacket
Source§fn from(tlc_err_packet: TlcErrPacket) -> Self
fn from(tlc_err_packet: TlcErrPacket) -> Self
Converts to this type from the input type.
Source§impl From<TlcErrPacket> for TlcErrPacket
impl From<TlcErrPacket> for TlcErrPacket
Source§fn from(tlc_err_packet: TlcErrPacket) -> Self
fn from(tlc_err_packet: TlcErrPacket) -> Self
Converts to this type from the input type.
Source§impl Hash for TlcErrPacket
impl Hash for TlcErrPacket
Source§impl PartialEq for TlcErrPacket
impl PartialEq for TlcErrPacket
Source§impl Serialize for TlcErrPacket
impl Serialize for TlcErrPacket
impl Eq for TlcErrPacket
impl StructuralPartialEq for TlcErrPacket
Auto Trait Implementations§
impl Freeze for TlcErrPacket
impl RefUnwindSafe for TlcErrPacket
impl Send for TlcErrPacket
impl Sync for TlcErrPacket
impl Unpin for TlcErrPacket
impl UnsafeUnpin for TlcErrPacket
impl UnwindSafe for TlcErrPacket
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
Mutably borrows from an owned value. Read more