support for user agents
This commit is contained in:
@ -37,6 +37,7 @@ import (
|
||||
"github.com/ethereum/go-ethereum/rpc/codec"
|
||||
"github.com/ethereum/go-ethereum/rpc/comms"
|
||||
"github.com/ethereum/go-ethereum/rpc/shared"
|
||||
"github.com/ethereum/go-ethereum/rpc/useragent"
|
||||
"github.com/ethereum/go-ethereum/xeth"
|
||||
)
|
||||
|
||||
@ -71,6 +72,7 @@ var (
|
||||
"admin_httpGet": (*adminApi).HttpGet,
|
||||
"admin_sleepBlocks": (*adminApi).SleepBlocks,
|
||||
"admin_sleep": (*adminApi).Sleep,
|
||||
"admin_enableUserAgent": (*adminApi).EnableUserAgent,
|
||||
}
|
||||
)
|
||||
|
||||
@ -474,3 +476,10 @@ func (self *adminApi) HttpGet(req *shared.Request) (interface{}, error) {
|
||||
|
||||
return string(resp), nil
|
||||
}
|
||||
|
||||
func (self *adminApi) EnableUserAgent(req *shared.Request) (interface{}, error) {
|
||||
if fe, ok := self.xeth.Frontend().(*useragent.RemoteFrontend); ok {
|
||||
fe.Enable()
|
||||
}
|
||||
return true, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user