pub struct ChannelAnnouncement {
pub node1_signature: Option<EcdsaSignature>,
pub node2_signature: Option<EcdsaSignature>,
pub ckb_signature: Option<SchnorrSignature>,
pub features: u64,
pub chain_hash: Hash256,
pub channel_outpoint: OutPoint,
pub node1_id: Pubkey,
pub node2_id: Pubkey,
pub ckb_key: XOnlyPublicKey,
pub capacity: u128,
pub udt_type_script: Option<Script>,
}Expand description
Announcement of a new channel in the network.
This message is broadcast to all nodes to inform them about a new channel. It contains the channel’s capacity, the nodes involved, and signatures.
Fields§
§node1_signature: Option<EcdsaSignature>Signature from node 1
node2_signature: Option<EcdsaSignature>Signature from node 2
ckb_signature: Option<SchnorrSignature>Signature signed by the funding transaction output public key
features: u64Feature flags for the channel
chain_hash: Hash256The chain hash this channel belongs to
channel_outpoint: OutPointThe outpoint of the funding transaction
node1_id: PubkeyPublic key of node 1
node2_id: PubkeyPublic key of node 2
ckb_key: XOnlyPublicKeyThe aggregated public key of the funding transaction output
capacity: u128The total capacity of the channel
udt_type_script: Option<Script>UDT type script if this is a UDT channel
Implementations§
Source§impl ChannelAnnouncement
impl ChannelAnnouncement
Sourcepub fn new_unsigned(
node1_pubkey: &Pubkey,
node2_pubkey: &Pubkey,
channel_outpoint: OutPoint,
chain_hash: Hash256,
ckb_pubkey: &XOnlyPublicKey,
capacity: u128,
udt_type_script: Option<Script>,
) -> Self
pub fn new_unsigned( node1_pubkey: &Pubkey, node2_pubkey: &Pubkey, channel_outpoint: OutPoint, chain_hash: Hash256, ckb_pubkey: &XOnlyPublicKey, capacity: u128, udt_type_script: Option<Script>, ) -> Self
Create an unsigned channel announcement with the given parameters.
Source§impl ChannelAnnouncement
impl ChannelAnnouncement
Sourcepub fn message_to_sign(&self) -> [u8; 32]
pub fn message_to_sign(&self) -> [u8; 32]
Get the message bytes to sign (hash of unsigned molecule serialization).
Trait Implementations§
Source§impl Clone for ChannelAnnouncement
impl Clone for ChannelAnnouncement
Source§fn clone(&self) -> ChannelAnnouncement
fn clone(&self) -> ChannelAnnouncement
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 ChannelAnnouncement
impl Debug for ChannelAnnouncement
Source§impl<'de> Deserialize<'de> for ChannelAnnouncement
impl<'de> Deserialize<'de> for ChannelAnnouncement
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 From<ChannelAnnouncement> for ChannelAnnouncement
impl From<ChannelAnnouncement> for ChannelAnnouncement
Source§fn from(channel_announcement: ChannelAnnouncement) -> Self
fn from(channel_announcement: ChannelAnnouncement) -> Self
Converts to this type from the input type.
Source§impl Hash for ChannelAnnouncement
impl Hash for ChannelAnnouncement
Source§impl PartialEq for ChannelAnnouncement
impl PartialEq for ChannelAnnouncement
Source§impl Serialize for ChannelAnnouncement
impl Serialize for ChannelAnnouncement
impl Eq for ChannelAnnouncement
impl StructuralPartialEq for ChannelAnnouncement
Auto Trait Implementations§
impl !Freeze for ChannelAnnouncement
impl RefUnwindSafe for ChannelAnnouncement
impl Send for ChannelAnnouncement
impl Sync for ChannelAnnouncement
impl Unpin for ChannelAnnouncement
impl UnsafeUnpin for ChannelAnnouncement
impl UnwindSafe for ChannelAnnouncement
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