aboutsummaryrefslogtreecommitdiffstats
path: root/node
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2017-03-06 17:37:32 +0800
committerFelix Lange <fjl@users.noreply.github.com>2017-03-09 22:50:14 +0800
commit023670f6bafcfed28c01857da215217a5dadfaa1 (patch)
tree2ced9d0178bfd8d101356a64522cf0225f98362e /node
parent567d41d9363706b4b13ce0903804e8acf214af49 (diff)
downloaddexon-023670f6bafcfed28c01857da215217a5dadfaa1.tar
dexon-023670f6bafcfed28c01857da215217a5dadfaa1.tar.gz
dexon-023670f6bafcfed28c01857da215217a5dadfaa1.tar.bz2
dexon-023670f6bafcfed28c01857da215217a5dadfaa1.tar.lz
dexon-023670f6bafcfed28c01857da215217a5dadfaa1.tar.xz
dexon-023670f6bafcfed28c01857da215217a5dadfaa1.tar.zst
dexon-023670f6bafcfed28c01857da215217a5dadfaa1.zip
cmd, eth, les, node, pow: disk caching and progress reports
Diffstat (limited to 'node')
-rw-r--r--node/service.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/node/service.go b/node/service.go
index 1cd1fe808..5e1eb0e64 100644
--- a/node/service.go
+++ b/node/service.go
@@ -46,6 +46,13 @@ func (ctx *ServiceContext) OpenDatabase(name string, cache int, handles int) (et
return ethdb.NewLDBDatabase(ctx.config.resolvePath(name), cache, handles)
}
+// ResolvePath resolves a user path into the data directory if that was relative
+// and if the user actually uses persistent storage. It will return an empty string
+// for emphemeral storage and the user's own input for absolute paths.
+func (ctx *ServiceContext) ResolvePath(path string) string {
+ return ctx.config.resolvePath(path)
+}
+
// Service retrieves a currently running service registered of a specific type.
func (ctx *ServiceContext) Service(service interface{}) error {
element := reflect.ValueOf(service).Elem()