aboutsummaryrefslogtreecommitdiffstats
path: root/mobile/geth.go
diff options
context:
space:
mode:
Diffstat (limited to 'mobile/geth.go')
-rw-r--r--mobile/geth.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/mobile/geth.go b/mobile/geth.go
index 488a4150f..645b360eb 100644
--- a/mobile/geth.go
+++ b/mobile/geth.go
@@ -29,6 +29,7 @@ import (
"github.com/ethereum/go-ethereum/eth/downloader"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/ethereum/go-ethereum/ethstats"
+ "github.com/ethereum/go-ethereum/internal/debug"
"github.com/ethereum/go-ethereum/les"
"github.com/ethereum/go-ethereum/node"
"github.com/ethereum/go-ethereum/p2p"
@@ -72,6 +73,9 @@ type NodeConfig struct {
// WhisperEnabled specifies whether the node should run the Whisper protocol.
WhisperEnabled bool
+
+ // Listening address of pprof server.
+ PprofAddress string
}
// defaultNodeConfig contains the default node configuration values to use if all
@@ -107,6 +111,11 @@ func NewNode(datadir string, config *NodeConfig) (stack *Node, _ error) {
if config.BootstrapNodes == nil || config.BootstrapNodes.Size() == 0 {
config.BootstrapNodes = defaultNodeConfig.BootstrapNodes
}
+
+ if config.PprofAddress != "" {
+ debug.StartPProf(config.PprofAddress)
+ }
+
// Create the empty networking stack
nodeConf := &node.Config{
Name: clientIdentifier,
@@ -127,6 +136,8 @@ func NewNode(datadir string, config *NodeConfig) (stack *Node, _ error) {
return nil, err
}
+ debug.Memsize.Add("node", rawStack)
+
var genesis *core.Genesis
if config.EthereumGenesis != "" {
// Parse the user supplied genesis spec if not mainnet