Skip to content

Commit

Permalink
export error (#498)
Browse files Browse the repository at this point in the history
* fix export error
  • Loading branch information
geekres authored and peekpi committed Sep 29, 2019
1 parent aed8b8a commit f8055ca
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions accountmanager/accountmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ func SetAccountNameConfig(config *Config) bool {
accountNameLength = config.AccountNameMaxLength
return true
}

func GetAccountNameRegExp() *regexp.Regexp {
return acctRegExp
}
Expand Down
1 change: 1 addition & 0 deletions blockchain/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ func (g *Genesis) ToBlock(db fdb.Database) (*types.Block, []*types.Receipt, erro
SubAssetNameMinLength: 1,
SubAssetNameMaxLength: 8,
})

am.SetAcctMangerName(common.StrToName(g.Config.AccountName))
at.SetAssetMangerName(common.StrToName(g.Config.AssetName))
fm.SetFeeManagerName(common.StrToName(g.Config.FeeName))
Expand Down
10 changes: 8 additions & 2 deletions cmd/ft/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ var RootCmd = &cobra.Command{
}

func makeNode() (*node.Node, error) {
genesis := blockchain.DefaultGenesis()
// set miner config
SetupMetrics()
// Make sure we have a valid genesis JSON
Expand All @@ -105,13 +106,18 @@ func makeNode() (*node.Node, error) {
}
defer file.Close()

genesis := blockchain.DefaultGenesis()
if err := json.NewDecoder(file).Decode(genesis); err != nil {
return nil, fmt.Errorf("invalid genesis file: %v(%v)", ftCfgInstance.GenesisFile, err)
}
ftCfgInstance.FtServiceCfg.Genesis = genesis
}

}
block, _, err := genesis.ToBlock(nil)
if err != nil {
return nil, err
}
// p2p used to generate MagicNetID
ftCfgInstance.NodeCfg.P2PConfig.GenesisHash = block.Hash()
return node.New(ftCfgInstance.NodeCfg)
}

Expand Down
2 changes: 0 additions & 2 deletions ftservice/ftservice.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,6 @@ func New(ctx *node.ServiceContext, config *Config) (*FtService, error) {
if err != nil {
return nil, err
}
// used to generate MagicNetID
ftservice.p2pServer.GenesisHash = ftservice.blockchain.Genesis().Hash()

// txpool
if config.TxPool.Journal != "" {
Expand Down

0 comments on commit f8055ca

Please sign in to comment.