Commit 932974bf authored by Luke Champine's avatar Luke Champine

implement HostSettings RPC

parent c14698e5
......@@ -63,6 +63,7 @@ func New(state *consensus.State, wallet modules.Wallet) (h *Host, err error) {
state: state,
wallet: wallet,
// default host settings
HostSettings: modules.HostSettings{
MaxFilesize: 4 * 1000 * 1000,
MaxDuration: 1008, // One week.
......@@ -127,6 +128,12 @@ func (h *Host) SetConfig(settings modules.HostSettings) {
h.HostSettings = settings
}
// Settings is an RPC used to request the settings of a host.
func (h *Host) Settings() (modules.HostSettings, error) {
// TODO: return an error if we haven't announced yet
return h.HostSettings, nil
}
type HostInfo struct {
modules.HostSettings
......
......@@ -99,6 +99,10 @@ func newDaemon(config DaemonConfig) (d *daemon, err error) {
if err != nil {
return
}
err = d.network.RegisterRPC("HostSettings", d.host.Settings)
if err != nil {
return
}
err = d.network.RegisterRPC("NegotiateContract", d.host.NegotiateContract)
if err != nil {
return
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment