@@ -1912,6 +1912,7 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
19121912 // when we're definitely concerned with only one account.
19131913 passphrase = list [0 ]
19141914 }
1915+
19151916 // Unlock the developer account by local keystore.
19161917 var ks * keystore.KeyStore
19171918 if keystores := stack .AccountManager ().Backends (keystore .KeyStoreType ); len (keystores ) > 0 {
@@ -1920,6 +1921,8 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
19201921 if ks == nil {
19211922 Fatalf ("Keystore is not available" )
19221923 }
1924+
1925+ // Figure out the dev account address.
19231926 // setEtherbase has been called above, configuring the miner address from command line flags.
19241927 if cfg .Miner .Etherbase != (common.Address {}) {
19251928 developer = accounts.Account {Address : cfg .Miner .Etherbase }
@@ -1931,6 +1934,10 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
19311934 Fatalf ("Failed to create developer account: %v" , err )
19321935 }
19331936 }
1937+ // Make sure the address is configured as fee recipient, otherwise
1938+ // the miner will fail to start.
1939+ cfg .Miner .Etherbase = developer .Address
1940+
19341941 if err := ks .Unlock (developer , passphrase ); err != nil {
19351942 Fatalf ("Failed to unlock developer account: %v" , err )
19361943 }
0 commit comments