Skip to content

Commit

Permalink
Add signature chainid guard for a legacy tx
Browse files Browse the repository at this point in the history
  • Loading branch information
kpp committed Jun 19, 2024
1 parent 4fc017d commit a3fa3f8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions crates/consensus/src/transaction/legacy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ impl SignableTransaction<Signature> for TxLegacy {
}

fn into_signed(self, signature: Signature) -> Signed<Self> {
debug_assert_eq!(signature.v().chain_id(), self.chain_id);
let mut buf = Vec::with_capacity(self.encoded_len_with_signature(&signature));
self.encode_with_signature_fields(&signature, &mut buf);
let hash = keccak256(&buf);
Expand Down

0 comments on commit a3fa3f8

Please sign in to comment.