Пример #1
0
	void SubmitBlock(const ConstBuf& data, RCString workid) override {
		String sdata = EXT_STR(data);
		if (HasSubmitBlockMethod) {
			try {
				DBG_LOCAL_IGNORE_CONDITION(ExtErr::JSON_RPC_MethodNotFound);
				VarValue par;
				if (!workid.empty())
					par.Set("workid", workid);
				ProcessSubmitResult(Call("submitblock", sdata, par));
				return;
			} catch (const system_error& ex) {
				if (ex.code() != json_rpc_errc::MethodNotFound) {
					TRC(1, ex.what());
					throw;
				}
				HasSubmitBlockMethod = false;
			}
		}
		if (!HasSubmitBlockMethod) {
			VarValue par;
			par.Set("data", sdata);
			ProcessSubmitResult(Call("getblocktemplate", par));
		}
	}
Пример #2
0
void IrcClient::OnPing(RCString server1, RCString server2) {
	String s = "PONG "+server1;
	if (!server2.empty())
		s += " " + server2;
	Send(s);
}