wip(onShareFound): adding files to git

pull/173/head
James Willhoite 2 years ago
parent 37fba30c79
commit 3d2fc4fbdf

@ -135,6 +135,11 @@ Params::Params(int argc, char* argv[])
ok = true;
}
if ((strcmp(argv[i], "--notify-on-share-found") == 0) && (i + 1 < argc)) {
m_onShareFound = argv[++i];
ok = true;
}
if (!ok) {
fprintf(stderr, "Unknown command line parameter %s\n\n", argv[i]);
p2pool_usage();

@ -50,6 +50,7 @@ struct Params
bool m_mini = false;
bool m_autoDiff = true;
std::string m_rpcLogin;
std::string m_onShareFound;
};
} // namespace p2pool

@ -847,6 +847,19 @@ void StratumServer::on_share_found(uv_work_t* req)
const char* s = client->m_customUser;
LOGINFO(0, log::Green() << "SHARE FOUND: mainchain height " << height << ", diff " << sidechain_difficulty << ", client " << static_cast<char*>(client->m_addrString) << (*s ? " user " : "") << s << ", effort " << effort << '%');
pool->submit_sidechain_block(share->m_templateId, share->m_nonce, share->m_extraNonce);
if(!pool->params().m_onShareFound.empty())
{
std::string s = pool->params().m_onShareFound;
s += " TEST";
char sys[s.length() + 1];
strcpy(sys, s.c_str());
if(!system(sys))
{
LOGINFO(4, "ERROR Calling onShareFound");
}
}
}
// Send the response to miner

Loading…
Cancel
Save