good morning!!!!

Skip to content
Snippets Groups Projects
Commit 67c47459 authored by Felix Lange's avatar Felix Lange
Browse files

core/types: handle nil ChainId in NewEIP155Signer

All uses of ChainConfig.ChainId eventually end up in NewEIP155Signer.
This fixes the case where users forget to set the ChainId in their
config.
parent 0f4b75be
Branches
Tags
No related merge requests found
...@@ -112,6 +112,9 @@ type EIP155Signer struct { ...@@ -112,6 +112,9 @@ type EIP155Signer struct {
} }
func NewEIP155Signer(chainId *big.Int) EIP155Signer { func NewEIP155Signer(chainId *big.Int) EIP155Signer {
if chainId == nil {
chainId = new(big.Int)
}
return EIP155Signer{ return EIP155Signer{
chainId: chainId, chainId: chainId,
chainIdMul: new(big.Int).Mul(chainId, big.NewInt(2)), chainIdMul: new(big.Int).Mul(chainId, big.NewInt(2)),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment