mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-24 13:46:43 +00:00
core/types: fix LatestSignerForChainID panic with chainID 0
This commit is contained in:
parent
cbf0b5bc92
commit
e392a9bfeb
1 changed files with 2 additions and 2 deletions
|
|
@ -92,14 +92,14 @@ func LatestSigner(config *params.ChainConfig) Signer {
|
||||||
|
|
||||||
// LatestSignerForChainID returns the 'most permissive' Signer available. Specifically,
|
// LatestSignerForChainID returns the 'most permissive' Signer available. Specifically,
|
||||||
// this enables support for EIP-155 replay protection and all implemented EIP-2718
|
// this enables support for EIP-155 replay protection and all implemented EIP-2718
|
||||||
// transaction types if chainID is non-nil.
|
// transaction types if chainID is non-nil and greater than zero.
|
||||||
//
|
//
|
||||||
// Use this in transaction-handling code where the current block number and fork
|
// Use this in transaction-handling code where the current block number and fork
|
||||||
// configuration are unknown. If you have a ChainConfig, use LatestSigner instead.
|
// configuration are unknown. If you have a ChainConfig, use LatestSigner instead.
|
||||||
// If you have a ChainConfig and know the current block number, use MakeSigner instead.
|
// If you have a ChainConfig and know the current block number, use MakeSigner instead.
|
||||||
func LatestSignerForChainID(chainID *big.Int) Signer {
|
func LatestSignerForChainID(chainID *big.Int) Signer {
|
||||||
var signer Signer
|
var signer Signer
|
||||||
if chainID != nil {
|
if chainID != nil && chainID.Sign() > 0 {
|
||||||
signer = NewPragueSigner(chainID)
|
signer = NewPragueSigner(chainID)
|
||||||
} else {
|
} else {
|
||||||
signer = HomesteadSigner{}
|
signer = HomesteadSigner{}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue