Skip to content

Commit 67c4745

Browse files
committed
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.
1 parent 0f4b75b commit 67c4745

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

core/types/transaction_signing.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,9 @@ type EIP155Signer struct {
112112
}
113113

114114
func NewEIP155Signer(chainId *big.Int) EIP155Signer {
115+
if chainId == nil {
116+
chainId = new(big.Int)
117+
}
115118
return EIP155Signer{
116119
chainId: chainId,
117120
chainIdMul: new(big.Int).Mul(chainId, big.NewInt(2)),

0 commit comments

Comments
 (0)