Changeset View
Changeset View
Standalone View
Standalone View
src/interface/node.cpp
Show First 20 Lines • Show All 54 Lines • ▼ Show 20 Lines | class NodeImpl : public Node { | ||||
HTTPRPCRequestProcessor &httpRPCRequestProcessor) override { | HTTPRPCRequestProcessor &httpRPCRequestProcessor) override { | ||||
return AppInitMain(config, httpRPCRequestProcessor); | return AppInitMain(config, httpRPCRequestProcessor); | ||||
} | } | ||||
void appShutdown() override { | void appShutdown() override { | ||||
Interrupt(); | Interrupt(); | ||||
Shutdown(); | Shutdown(); | ||||
} | } | ||||
void startShutdown() override { StartShutdown(); } | void startShutdown() override { StartShutdown(); } | ||||
bool shutdownRequested() override { return ShutdownRequested(); } | |||||
void mapPort(bool use_upnp) override { | void mapPort(bool use_upnp) override { | ||||
if (use_upnp) { | if (use_upnp) { | ||||
StartMapPort(); | StartMapPort(); | ||||
} else { | } else { | ||||
InterruptMapPort(); | InterruptMapPort(); | ||||
StopMapPort(); | StopMapPort(); | ||||
} | } | ||||
} | } | ||||
bool getProxy(Network net, proxyType &proxy_info) override { | bool getProxy(Network net, proxyType &proxy_info) override { | ||||
return GetProxy(net, proxy_info); | return GetProxy(net, proxy_info); | ||||
} | } | ||||
std::unique_ptr<Handler> handleInitMessage(InitMessageFn fn) override { | std::unique_ptr<Handler> handleInitMessage(InitMessageFn fn) override { | ||||
return MakeHandler(::uiInterface.InitMessage.connect(fn)); | return MakeHandler(::uiInterface.InitMessage.connect(fn)); | ||||
} | } | ||||
std::unique_ptr<Handler> handleMessageBox(MessageBoxFn fn) override { | |||||
return MakeHandler(::uiInterface.ThreadSafeMessageBox.connect(fn)); | |||||
} | |||||
std::unique_ptr<Handler> handleQuestion(QuestionFn fn) override { | |||||
return MakeHandler(::uiInterface.ThreadSafeQuestion.connect(fn)); | |||||
} | |||||
}; | }; | ||||
} // namespace | } // namespace | ||||
std::unique_ptr<Node> MakeNode() { | std::unique_ptr<Node> MakeNode() { | ||||
return std::make_unique<NodeImpl>(); | return std::make_unique<NodeImpl>(); | ||||
} | } | ||||
} // namespace interface | } // namespace interface |