2020-08-12 13:47:59 +00:00
|
|
|
package commands
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
2020-09-26 21:01:11 +00:00
|
|
|
"fmt"
|
2020-08-12 13:47:59 +00:00
|
|
|
|
|
|
|
"github.com/ledgerwatch/turbo-geth/common"
|
|
|
|
)
|
|
|
|
|
2020-10-12 08:39:33 +00:00
|
|
|
// Propose changing this file name to eth_mining.go and adding missing mining related commands
|
|
|
|
|
2020-09-26 21:01:11 +00:00
|
|
|
// Coinbase is the address that mining rewards will be sent to
|
2020-08-12 13:47:59 +00:00
|
|
|
func (api *APIImpl) Coinbase(_ context.Context) (common.Address, error) {
|
2020-09-26 21:01:11 +00:00
|
|
|
if api.ethBackend == nil {
|
|
|
|
// We're running in --chaindata mode or otherwise cannot get the backend
|
|
|
|
return common.Address{}, fmt.Errorf(NotAvailableChainData, "eth_coinbase")
|
|
|
|
}
|
2020-08-12 13:47:59 +00:00
|
|
|
return api.ethBackend.Etherbase()
|
|
|
|
}
|
2020-10-12 08:39:33 +00:00
|
|
|
|
|
|
|
// Missing routines (incorrect interfaces)
|
|
|
|
|
|
|
|
// HashRate(ctx context.Context) (string, error) {}
|
|
|
|
// Mining(ctx context.Context) (string, error) {}
|
|
|
|
// GetWork(ctx context.Context) (string, error) {}
|
|
|
|
// SubmitWork(ctx context.Context) (string, error) {}
|
|
|
|
// SubmitHashrate(ctx context.Context) (string, error) {}
|