mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-19 13:21:37 +00:00
parent
b53fa6c6d9
commit
81ac9cfb7e
4 changed files with 7 additions and 10 deletions
|
|
@ -65,7 +65,7 @@ func (x *XDPoS_v2) verifyHeader(chain consensus.ChainReader, header *types.Heade
|
|||
if err != nil && parent.Number.Sign() != 0 { // skip genesis block
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
// Ensure gas used is less than or equal to gas limit
|
||||
if header.GasUsed > header.GasLimit {
|
||||
return fmt.Errorf("gas used exceeded gaslimit, gas used: %d, gas limit: %d", header.GasUsed, header.GasLimit)
|
||||
|
|
|
|||
|
|
@ -225,7 +225,7 @@ func SetupGenesisBlock(db ethdb.Database, genesis *Genesis) (*params.ChainConfig
|
|||
genesis = DefaultGenesisBlock()
|
||||
}
|
||||
// Ensure the stored genesis matches with the given one.
|
||||
hash := genesis.ToBlock(nil).Hash()
|
||||
hash := genesis.ToBlock().Hash()
|
||||
if hash != stored {
|
||||
return genesis.Config, hash, &GenesisMismatchError{stored, hash}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ func TestSetupGenesis(t *testing.T) {
|
|||
{
|
||||
name: "genesis header present but state missing",
|
||||
fn: func(db ethdb.Database) (*params.ChainConfig, common.Hash, error) {
|
||||
block := DefaultGenesisBlock().ToBlock(nil)
|
||||
block := DefaultGenesisBlock().ToBlock()
|
||||
rawdb.WriteCanonicalHash(db, block.Hash(), 0)
|
||||
rawdb.WriteHeader(db, block.Header())
|
||||
return SetupGenesisBlock(db, nil)
|
||||
|
|
@ -132,7 +132,7 @@ func TestSetupGenesis(t *testing.T) {
|
|||
{
|
||||
name: "genesis block without chain config",
|
||||
fn: func(db ethdb.Database) (*params.ChainConfig, common.Hash, error) {
|
||||
block := DefaultGenesisBlock().ToBlock(db)
|
||||
block := DefaultGenesisBlock().ToBlock()
|
||||
rawdb.WriteBlock(db, block)
|
||||
rawdb.WriteCanonicalHash(db, block.Hash(), 0)
|
||||
return SetupGenesisBlock(db, nil)
|
||||
|
|
@ -143,10 +143,7 @@ func TestSetupGenesis(t *testing.T) {
|
|||
{
|
||||
name: "missing block number for head header hash",
|
||||
fn: func(db ethdb.Database) (*params.ChainConfig, common.Hash, error) {
|
||||
block := DefaultGenesisBlock().ToBlock(db)
|
||||
rawdb.WriteBlock(db, block)
|
||||
rawdb.WriteCanonicalHash(db, block.Hash(), 0)
|
||||
rawdb.WriteChainConfig(db, block.Hash(), params.XDCMainnetChainConfig)
|
||||
DefaultGenesisBlock().MustCommit(db)
|
||||
rawdb.WriteHeadHeaderHash(db, common.HexToHash("0xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"))
|
||||
return SetupGenesisBlock(db, nil)
|
||||
},
|
||||
|
|
|
|||
|
|
@ -525,8 +525,8 @@ func (s *Service) login(conn *connWrapper) error {
|
|||
auth := &authMsg{
|
||||
ID: s.node,
|
||||
Info: nodeInfo{
|
||||
Name: s.node,
|
||||
Node: infos.Name,
|
||||
Name: s.node,
|
||||
Node: infos.Name,
|
||||
Coinbase: s.coinbase,
|
||||
Port: infos.Ports.Listener,
|
||||
Network: network,
|
||||
|
|
|
|||
Loading…
Reference in a new issue