params: reduce extra data to 32 bytes

This commit is contained in:
Jeffrey Wilcke
2015-07-26 12:24:52 +02:00
parent b0df9b164c
commit 8865fda872
3 changed files with 13 additions and 4 deletions

View File

@ -45,6 +45,7 @@ import (
"github.com/ethereum/go-ethereum/p2p"
"github.com/ethereum/go-ethereum/p2p/discover"
"github.com/ethereum/go-ethereum/p2p/nat"
"github.com/ethereum/go-ethereum/params"
"github.com/ethereum/go-ethereum/whisper"
)
@ -369,8 +370,8 @@ func New(config *Config) (*Ethereum, error) {
eth.miner.SetGasPrice(config.GasPrice)
extra := config.Name
if len(extra) > 1024 {
extra = extra[:1024]
if uint64(len(extra)) > params.MaximumExtraDataSize.Uint64() {
extra = extra[:params.MaximumExtraDataSize.Uint64()]
}
eth.miner.SetExtra([]byte(extra))