container: add Address function for interface

This commit is contained in:
Edwin 2017-08-21 17:15:14 +08:00
parent 80c6aa0738
commit 49eabb5773
1 changed files with 7 additions and 0 deletions

View File

@ -36,7 +36,9 @@ import (
"github.com/docker/docker/client"
"github.com/docker/go-connections/nat"
"github.com/ethereum/go-ethereum/cmd/utils"
"github.com/ethereum/go-ethereum/common"
ethtypes "github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/ethereum/go-ethereum/p2p/discover"
@ -59,6 +61,7 @@ type Ethereum interface {
Stop() error
NodeAddress() string
Address() common.Address
ContainerID() string
Host() string
@ -363,6 +366,10 @@ func (eth *ethereum) NodeAddress() string {
return ""
}
func (eth *ethereum) Address() common.Address {
return crypto.PubkeyToAddress(eth.key.PublicKey)
}
func (eth *ethereum) ConsensusMonitor(errCh chan<- error, quit chan struct{}) {
cli := eth.NewClient()