Skip to content

Commit 16edbd4

Browse files
committed
Sign gossip messages without grinding low R signatures
Gossip messages always use signatures in their compact form, so grinding for low R signatures is unnecessary.
1 parent 78b967f commit 16edbd4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lightning/src/chain/keysinterface.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -928,7 +928,7 @@ impl EcdsaChannelSigner for InMemorySigner {
928928
&self, msg: &UnsignedChannelAnnouncement, secp_ctx: &Secp256k1<secp256k1::All>
929929
) -> Result<Signature, ()> {
930930
let msghash = hash_to_message!(&Sha256dHash::hash(&msg.encode()[..])[..]);
931-
Ok(sign(secp_ctx, &msghash, &self.funding_key))
931+
Ok(secp_ctx.sign_ecdsa(&msghash, &self.funding_key))
932932
}
933933
}
934934

@@ -1335,7 +1335,7 @@ impl NodeSigner for KeysManager {
13351335

13361336
fn sign_gossip_message(&self, msg: UnsignedGossipMessage) -> Result<Signature, ()> {
13371337
let msg_hash = hash_to_message!(&Sha256dHash::hash(&msg.encode()[..])[..]);
1338-
Ok(sign(&self.secp_ctx, &msg_hash, &self.node_secret))
1338+
Ok(self.secp_ctx.sign_ecdsa(&msg_hash, &self.node_secret))
13391339
}
13401340
}
13411341

0 commit comments

Comments
 (0)