Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: transcoder/CasinoCoin
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: Crypto-Expert/CasinoCoin
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Dec 17, 2013

  1. Added SubmitBlock

    ahmedbodi committed Dec 17, 2013
    Copy the full SHA
    79ea2f8 View commit details
Showing with 25 additions and 2 deletions.
  1. +25 −2 src/bitcoinrpc.cpp
27 changes: 25 additions & 2 deletions src/bitcoinrpc.cpp
Original file line number Diff line number Diff line change
@@ -2139,10 +2139,10 @@ Value getblocktemplate(const Array& params, bool fHelp)
if (strMode == "template")
{
if (vNodes.empty())
throw JSONRPCError(-9, "CasinoCoin is not connected!");
throw JSONRPCError(-9, "GrandCoin is not connected!");

if (IsInitialBlockDownload())
throw JSONRPCError(-10, "CasinoCoin is downloading blocks...");
throw JSONRPCError(-10, "GrandCoin is downloading blocks...");

static CReserveKey reservekey(pwalletMain);

@@ -2259,7 +2259,30 @@ Value getblocktemplate(const Array& params, bool fHelp)

throw JSONRPCError(-8, "Invalid mode");
}
Value submitblock(const Array& params, bool fHelp)
{
if (fHelp || params.size() < 1 || params.size() > 2)
throw runtime_error(
"submitblock <hex data> [optional-params-obj]\n"
"[optional-params-obj] parameter is currently ignored.\n"
"Attempts to submit new block to network.\n"
"See https://en.bitcoin.it/wiki/BIP_0022 for full specification.");

vector<unsigned char> blockData(ParseHex(params[0].get_str()));
CDataStream ssBlock(blockData, SER_NETWORK, PROTOCOL_VERSION);
CBlock block;
try {
ssBlock >> block;
}
catch (std::exception &e) {
throw JSONRPCError(-22, "Block decode failed");
}
bool fAccepted = ProcessBlock(NULL, &block);
if (!fAccepted)
throw JSONRPCError(-23, "Block rejected");

return true;
}
Value getrawmempool(const Array& params, bool fHelp)
{
if (fHelp || params.size() != 0)