We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 157af6e commit e1b50cfCopy full SHA for e1b50cf
lightning/src/routing/gossip.rs
@@ -130,6 +130,18 @@ impl Readable for NodeId {
130
}
131
132
133
+impl From<PublicKey> for NodeId {
134
+ fn from(pubkey: PublicKey) -> Self {
135
+ Self::from_pubkey(&pubkey)
136
+ }
137
+}
138
+
139
+impl From<NodeId> for PublicKey {
140
+ fn from(node_id: NodeId) -> PublicKey {
141
+ PublicKey::from_slice( &node_id.0).unwrap()
142
143
144
145
/// Represents the network as nodes and channels between them
146
pub struct NetworkGraph<L: Deref> where L::Target: Logger {
147
secp_ctx: Secp256k1<secp256k1::VerifyOnly>,
0 commit comments