Skip to content

Commit

Permalink
core/types: correct chainId check for pragueSigner
Browse files Browse the repository at this point in the history
  • Loading branch information
tnasu committed Jan 28, 2025
1 parent 642a46e commit c190500
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions blockchain/types/transaction_signing.go
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ func (s pragueSigner) SignatureValues(tx *Transaction, sig []byte) (R, S, V *big

// Check that chain ID of tx matches the signer. We also accept ID zero or nil here,
// because it indicates that the chain ID was not specified in the tx.
if tx.data.ChainId() != nil && tx.data.ChainId().Sign() != 0 && tx.data.ChainId().Cmp(s.ChainID()) != 0 {
if tx.data.ChainId().Sign() != 0 && tx.data.ChainId().Cmp(s.ChainID()) != 0 {
return nil, nil, nil, ErrInvalidChainId
}

Expand Down Expand Up @@ -439,7 +439,7 @@ func (s londonSigner) SignatureValues(tx *Transaction, sig []byte) (R, S, V *big

// Check that chain ID of tx matches the signer. We also accept ID zero or nil here,
// because it indicates that the chain ID was not specified in the tx.
if tx.data.ChainId() != nil && tx.data.ChainId().Sign() != 0 && tx.data.ChainId().Cmp(s.ChainID()) != 0 {
if tx.data.ChainId().Sign() != 0 && tx.data.ChainId().Cmp(s.ChainID()) != 0 {
return nil, nil, nil, ErrInvalidChainId
}

Expand Down Expand Up @@ -542,7 +542,7 @@ func (s eip2930Signer) SignatureValues(tx *Transaction, sig []byte) (R, S, V *bi

// Check that chain ID of tx matches the signer. We also accept ID zero or nil here,
// because it indicates that the chain ID was not specified in the tx.
if tx.data.ChainId() != nil && tx.data.ChainId().Sign() != 0 && tx.data.ChainId().Cmp(s.ChainID()) != 0 {
if tx.data.ChainId().Sign() != 0 && tx.data.ChainId().Cmp(s.ChainID()) != 0 {
return nil, nil, nil, ErrInvalidChainId
}

Expand Down

0 comments on commit c190500

Please sign in to comment.