diff options
author | zelig <viktor.tron@gmail.com> | 2015-04-22 21:55:01 +0800 |
---|---|---|
committer | zelig <viktor.tron@gmail.com> | 2015-04-24 19:45:11 +0800 |
commit | 6b1b5a4a2a8b315f4d0e7a08ab10563653711a92 (patch) | |
tree | 697ed17f77ce843ce0086e9532a2ee2d992a906d /cmd/geth/js.go | |
parent | 1b7c017076ae578a89a18b5c7ffc61e9c8d59eee (diff) | |
download | dexon-6b1b5a4a2a8b315f4d0e7a08ab10563653711a92.tar.gz dexon-6b1b5a4a2a8b315f4d0e7a08ab10563653711a92.tar.zst dexon-6b1b5a4a2a8b315f4d0e7a08ab10563653711a92.zip |
cli/js console: if corsDomain is not given to startRpc, we fall back to value set on command line with `-corsDomain`
Diffstat (limited to 'cmd/geth/js.go')
-rw-r--r-- | cmd/geth/js.go | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/cmd/geth/js.go b/cmd/geth/js.go index abbd65513..a545de1d0 100644 --- a/cmd/geth/js.go +++ b/cmd/geth/js.go @@ -59,17 +59,19 @@ func (r dumbterm) PasswordPrompt(p string) (string, error) { func (r dumbterm) AppendHistory(string) {} type jsre struct { - re *re.JSRE - ethereum *eth.Ethereum - xeth *xeth.XEth - ps1 string - atexit func() - + re *re.JSRE + ethereum *eth.Ethereum + xeth *xeth.XEth + ps1 string + atexit func() + corsDomain string prompter } -func newJSRE(ethereum *eth.Ethereum, libPath string, interactive bool) *jsre { +func newJSRE(ethereum *eth.Ethereum, libPath string, interactive bool, corsDomain string) *jsre { js := &jsre{ethereum: ethereum, ps1: "> "} + // set default cors domain used by startRpc from CLI flag + js.corsDomain = corsDomain js.xeth = xeth.New(ethereum, js) js.re = re.New(libPath) js.apiBindings() |