Advertisement
Guest User

Untitled

a guest
May 28th, 2018
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.62 KB | None | 0 0
  1. diff -Bur nos2/src/rpcmining.cpp NOS-Coin/src/rpcmining.cpp
  2. --- nos2/src/rpcmining.cpp 2018-05-28 11:35:46.560259131 -0400
  3. +++ NOS-Coin/src/rpcmining.cpp 2018-05-28 03:13:27.426744091 -0400
  4. @@ -2,6 +2,7 @@
  5. // Copyright (c) 2009-2014 The Bitcoin developers
  6. // Copyright (c) 2014-2015 The Dash developers
  7. // Copyright (c) 2015-2017 The PIVX developers
  8. // Distributed under the MIT software license, see the accompanying
  9. // file COPYING or http://www.opensource.org/licenses/mit-license.php.
  10.  
  11. @@ -16,10 +17,8 @@
  12. #include "pow.h"
  13. #include "rpcserver.h"
  14. #include "util.h"
  15. -#ifdef ENABLE_WALLET
  16. #include "db.h"
  17. #include "wallet.h"
  18. -#endif
  19.  
  20. #include <stdint.h>
  21.  
  22. @@ -31,11 +30,88 @@
  23. using namespace json_spirit;
  24. using namespace std;
  25.  
  26. -#ifdef ENABLE_WALLET
  27. +#include <openssl/ripemd.h>
  28. +#include <openssl/sha.h>
  29. +#include "utilmoneystr.h"
  30. +#include "uint256.h"
  31. +typedef map<uint256, pair<CBlock*, CScript> > mapNewBlock_t;
  32. +extern CWallet* pwalletMain;
  33. +inline uint32_t ByteReverse(uint32_t value)
  34. +{
  35. + value = ((value & 0xFF00FF00) >> 8) | ((value & 0x00FF00FF) << 8);
  36. + return (value<<16) | (value>>16);
  37. +}
  38. +int static FormatHashBlocks(void* pbuffer, unsigned int len)
  39. +{
  40. + unsigned char* pdata = (unsigned char*)pbuffer;
  41. + unsigned int blocks = 1 + ((len + 8) / 64);
  42. + unsigned char* pend = pdata + 64 * blocks;
  43. + memset(pdata + len, 0, 64 * blocks - len);
  44. + pdata[len] = 0x80;
  45. + unsigned int bits = len * 8;
  46. + pend[-1] = (bits >> 0) & 0xff;
  47. + pend[-2] = (bits >> 8) & 0xff;
  48. + pend[-3] = (bits >> 16) & 0xff;
  49. + pend[-4] = (bits >> 24) & 0xff;
  50. + return blocks;
  51. +}
  52. +static const unsigned int pSHA256InitState[8] =
  53. +{0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19};
  54. +void SHA256Transform(void* pstate, void* pinput, const void* pinit)
  55. +{
  56. + SHA256_CTX ctx;
  57. + unsigned char data[64];
  58. + SHA256_Init(&ctx);
  59. + for (int i = 0; i < 16; i++)
  60. + ((uint32_t*)data)[i] = ByteReverse(((uint32_t*)pinput)[i]);
  61. + for (int i = 0; i < 8; i++)
  62. + ctx.h[i] = ((uint32_t*)pinit)[i];
  63. + SHA256_Update(&ctx, data, sizeof(data));
  64. + for (int i = 0; i < 8; i++)
  65. + ((uint32_t*)pstate)[i] = ctx.h[i];
  66. +}
  67. +void FormatHashBuffers(CBlock* pblock, char* pmidstate, char* pdata, char* phash1)
  68. +{
  69. + struct
  70. + {
  71. + struct unnamed2
  72. + {
  73. + int nVersion;
  74. + uint256 hashPrevBlock;
  75. + uint256 hashMerkleRoot;
  76. + unsigned int nTime;
  77. + unsigned int nBits;
  78. + unsigned int nNonce;
  79. + }
  80. + block;
  81. + unsigned char pchPadding0[64];
  82. + uint256 hash1;
  83. + unsigned char pchPadding1[64];
  84. + }
  85. + tmp;
  86. + memset(&tmp, 0, sizeof(tmp));
  87. + tmp.block.nVersion = pblock->nVersion;
  88. + tmp.block.hashPrevBlock = pblock->hashPrevBlock;
  89. + tmp.block.hashMerkleRoot = pblock->hashMerkleRoot;
  90. + tmp.block.nTime = pblock->nTime;
  91. + tmp.block.nBits = pblock->nBits;
  92. + tmp.block.nNonce = pblock->nNonce;
  93. + FormatHashBlocks(&tmp.block, sizeof(tmp.block));
  94. + FormatHashBlocks(&tmp.hash1, sizeof(tmp.hash1));
  95. + // Byte swap all the input buffer
  96. + for (unsigned int i = 0; i < sizeof(tmp)/4; i++)
  97. + ((unsigned int*)&tmp)[i] = ByteReverse(((unsigned int*)&tmp)[i]);
  98. +
  99. + // Precalc the first half of the first hash, which stays constant
  100. + SHA256Transform(pmidstate, &tmp.block, pSHA256InitState);
  101. + memcpy(pdata, &tmp.block, 128);
  102. + memcpy(phash1, &tmp.hash1, 64);
  103. +}
  104. // Key used by getwork miners.
  105. // Allocated in InitRPCMining, free'd in ShutdownRPCMining
  106. static CReserveKey* pMiningKey = NULL;
  107. -
  108. +static CScript scriptPubKey;
  109. void InitRPCMining()
  110. {
  111. if (!pwalletMain)
  112. @@ -40,11 +116,17 @@
  113. {
  114. if (!pwalletMain)
  115. return;
  116. -
  117. // getwork/getblocktemplate mining rewards paid here:
  118. - pMiningKey = new CReserveKey(pwalletMain);
  119. + if (pMiningKey==NULL)
  120. + {
  121. + pMiningKey = new CReserveKey(pwalletMain);
  122. + // Create new block
  123. + CPubKey pubkey;
  124. + pMiningKey->GetReservedKey(pubkey);
  125. + scriptPubKey = CScript() << ToByteVector(pubkey) << OP_CHECKSIG;
  126. + }
  127. + return;
  128. }
  129. -
  130. void ShutdownRPCMining()
  131. {
  132. if (!pMiningKey)
  133. @@ -49,17 +131,242 @@
  134. {
  135. if (!pMiningKey)
  136. return;
  137. -
  138. delete pMiningKey; pMiningKey = NULL;
  139. }
  140. -#else
  141. -void InitRPCMining()
  142. +
  143. +class submitblock_StateCatcher_G : public CValidationInterface
  144. {
  145. +public:
  146. + uint256 hash;
  147. + bool found;
  148. + CValidationState state;
  149. +
  150. + submitblock_StateCatcher_G(const uint256 &hashIn) : hash(hashIn), found(false), state() {}
  151. +
  152. +protected:
  153. + virtual void BlockChecked(const CBlock& block, const CValidationState& stateIn) {
  154. + if (block.GetHash() != hash)
  155. + return;
  156. + found = true;
  157. + state = stateIn;
  158. + }
  159. +};
  160. +
  161. +bool BIP22ValidationResult_G(const CValidationState& state)
  162. +{
  163. + if (state.IsValid())
  164. + return true;
  165. +
  166. + std::string strRejectReason = state.GetRejectReason();
  167. + if (state.IsError())
  168. + throw JSONRPCError(RPC_VERIFY_ERROR, strRejectReason);
  169. + if (state.IsInvalid())
  170. + {
  171. + if (strRejectReason.empty())
  172. + return false;
  173. + return false;
  174. + }
  175. + // Should be impossible
  176. + return true;
  177. }
  178. -void ShutdownRPCMining()
  179. +bool ProcessBlock(CValidationState &state, CNode* pfrom, CBlock* pblock)
  180. {
  181. + AssertLockHeld(cs_main);
  182. + //LogPrintf("ProcessBlock() started\n");
  183. + // Check for duplicate
  184. + uint256 hash = pblock->GetHash();
  185. + bool fBlockPresent = false;
  186. + {
  187. + LOCK(cs_main);
  188. + BlockMap::iterator mi = mapBlockIndex.find(hash);
  189. + if (mi != mapBlockIndex.end()) {
  190. + CBlockIndex *pindex = mi->second;
  191. + if (pindex->IsValid(BLOCK_VALID_SCRIPTS))
  192. + return error("ProcessBlock() : duplicate");
  193. + if (pindex->nStatus & BLOCK_FAILED_MASK)
  194. + return error("ProcessBlock() : duplicate-invalid");
  195. + // Otherwise, we might only have the header - process the block before returning
  196. + fBlockPresent = true;
  197. + }
  198. + }
  199. +
  200. + submitblock_StateCatcher_G sc(pblock->GetHash());
  201. + RegisterValidationInterface(&sc);
  202. + bool fAccepted = ProcessNewBlock(state, NULL, pblock);
  203. + UnregisterValidationInterface(&sc);
  204. + if (fBlockPresent)
  205. + {
  206. + if (fAccepted && !sc.found)
  207. + return true;
  208. + return true;
  209. + }
  210. + if (!sc.found)
  211. + return true;
  212. + bool result=BIP22ValidationResult_G(sc.state);
  213. + if(!result)
  214. + {
  215. + return error("ProcessBlock() : AcceptBlock FAILED");
  216. + }
  217. + LogPrintf("ProcessBlock: ACCEPTED\n");
  218. + return true;
  219. }
  220. -#endif
  221. +bool CheckWork(CBlock* pblock, CWallet& wallet, CReserveKey& reservekey)
  222. +{
  223. + uint256 hashPoW = pblock->GetHash();
  224. + uint256 hashTarget = uint256().SetCompact(pblock->nBits);
  225. + uint256 hashBlock = pblock->GetHash();
  226. + //// debug print
  227. + LogPrintf("Wallet mining:\n");
  228. + LogPrintf("proof-of-work found \n block-hash: %s\n pow-hash: %s\ntarget: %s\n",
  229. + hashBlock.GetHex(),
  230. + hashPoW.GetHex(),
  231. + hashTarget.GetHex());
  232. + LogPrintf("generated %s\n", FormatMoney(pblock->vtx[0].vout[0].nValue));
  233. + // Found a solution
  234. + {
  235. + LOCK(cs_main);
  236. + if (pblock->hashPrevBlock != chainActive.Tip()->GetBlockHash())
  237. + return error("Wallet mining : generated block is stale");
  238. + // Track how many getdata requests this block gets
  239. + {
  240. + LOCK(wallet.cs_wallet);
  241. + wallet.mapRequestCount[pblock->GetHash()] = 0;
  242. + }
  243. + // Process this block the same as if we had received it from another node
  244. + CValidationState state;
  245. + if (!ProcessBlock(state, NULL, pblock))
  246. + return error("Wallet mining : ProcessBlock, block not accepted");
  247. + }
  248. + return true;
  249. +}
  250. +
  251. +
  252. +Value getwork(const Array& params, bool fHelp)
  253. +{
  254. + InitRPCMining();
  255. + if (fHelp || params.size() > 1){
  256. + throw runtime_error(
  257. + "getwork ( \"data\" )\n"
  258. + "\nIf 'data' is not specified, it returns the formatted hash data to work on.\n"
  259. + "If 'data' is specified, tries to solve the block and returns true if it was successful.\n"
  260. + "\nArguments:\n"
  261. + "1. \"data\" (string, optional) The hex encoded data to solve\n"
  262. + "\nResult (when 'data' is not specified):\n"
  263. + "{\n"
  264. + " \"midstate\" : \"xxxx\", (string) The precomputed hash state after hashing the first half of the data (DEPRECATED)\n" // deprecated
  265. + " \"data\" : \"xxxxx\", (string) The block data\n"
  266. + " \"hash1\" : \"xxxxx\", (string) The formatted hash buffer for second hash (DEPRECATED)\n" // deprecated
  267. + " \"target\" : \"xxxx\" (string) The little endian hash target\n"
  268. + "}\n"
  269. + "\nResult (when 'data' is specified):\n"
  270. + "true|false (boolean) If solving the block specified in the 'data' was successfull\n"
  271. + "\nExamples:\n"
  272. + + HelpExampleCli("getwork", "")
  273. + + HelpExampleRpc("getwork", "")
  274. + );}
  275. +
  276. + if (IsInitialBlockDownload())
  277. + throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, "This wallet is downloading blocks...");
  278. +
  279. + static mapNewBlock_t mapNewBlock; // FIXME: thread safety
  280. + static vector<CBlockTemplate*> vNewBlockTemplate;
  281. +
  282. + if (params.size() == 0)
  283. + {
  284. + // Update block
  285. + static unsigned int nTransactionsUpdatedLast;
  286. + static CBlockIndex* pindexPrev;
  287. + static int64_t nStart;
  288. + static CBlockTemplate* pblocktemplate;
  289. + if (pindexPrev != chainActive.Tip() ||
  290. + (mempool.GetTransactionsUpdated() != nTransactionsUpdatedLast && GetTime() - nStart > 60))
  291. + {
  292. + if (pindexPrev != chainActive.Tip())
  293. + {
  294. + // Deallocate old blocks since they're obsolete now
  295. + mapNewBlock.clear();
  296. + for (std::vector<CBlockTemplate*>::size_type i=0;i!=vNewBlockTemplate.size();i++)
  297. + {
  298. + delete vNewBlockTemplate[i];
  299. + }
  300. + vNewBlockTemplate.clear();
  301. + }
  302. +
  303. + // Clear pindexPrev so future getworks make a new block, despite any failures from here on
  304. + pindexPrev = NULL;
  305. +
  306. + // Store the pindexBest used before CreateNewBlock, to avoid races
  307. + nTransactionsUpdatedLast = mempool.GetTransactionsUpdated();
  308. + CBlockIndex* pindexPrevNew = chainActive.Tip();
  309. + nStart = GetTime();
  310. +
  311. + pblocktemplate=CreateNewBlock(scriptPubKey, pwalletMain, false);
  312. + if (!pblocktemplate)
  313. + throw JSONRPCError(RPC_OUT_OF_MEMORY, "Out of memory");
  314. + vNewBlockTemplate.push_back(pblocktemplate);
  315. + // Need to update only after we know CreateNewBlock succeeded
  316. + pindexPrev = pindexPrevNew;
  317. + }
  318. + CBlock* pblock = &(vNewBlockTemplate.back()->block); // pointer for convenience
  319. +
  320. + // Update nTime
  321. + UpdateTime(pblock, pindexPrev);
  322. + pblock->nNonce = 0;
  323. +
  324. + // Update nExtraNonce
  325. + LOCK(cs_main);
  326. + static unsigned int nExtraNonce = 0;
  327. + IncrementExtraNonce(pblock, pindexPrev, nExtraNonce);
  328. +
  329. + // Save
  330. + mapNewBlock[pblock->hashMerkleRoot] = make_pair(pblock, pblock->vtx[0].vin[0].scriptSig);
  331. +
  332. + // Pre-build hash buffers
  333. + char pmidstate[32];
  334. + char pdata[128];
  335. + char phash1[64];
  336. + FormatHashBuffers(pblock, pmidstate, pdata, phash1);
  337. + uint256 hashTarget = uint256().SetCompact(pblock->nBits);
  338. +
  339. + Object result;
  340. + result.push_back(Pair("midstate", HexStr(BEGIN(pmidstate), END(pmidstate)))); // deprecated
  341. + result.push_back(Pair("data", HexStr(BEGIN(pdata), END(pdata))));
  342. + result.push_back(Pair("hash1", HexStr(BEGIN(phash1), END(phash1)))); // deprecated
  343. + result.push_back(Pair("target", HexStr(BEGIN(hashTarget), END(hashTarget))));
  344. + return result;
  345. + }
  346. + else
  347. + {
  348. +
  349. + // Parse parameters
  350. + vector<unsigned char> vchData = ParseHex(params[0].get_str());
  351. + if (vchData.size() != 128)
  352. + throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter");
  353. + CBlock* pdata = (CBlock*)&vchData[0];
  354. +
  355. +
  356. + // Byte reverse
  357. + for (int i = 0; i < 128/4; i++)
  358. + ((unsigned int*)pdata)[i] = ByteReverse(((unsigned int*)pdata)[i]);
  359. +
  360. + // Get saved block
  361. + if (!mapNewBlock.count(pdata->hashMerkleRoot))
  362. + return false;
  363. + CBlock* pblock = mapNewBlock[pdata->hashMerkleRoot].first;
  364. + pblock->nTime = pdata->nTime;
  365. + pblock->nNonce = pdata->nNonce;
  366. + CMutableTransaction txCoinbase(pblock->vtx[0]);
  367. + txCoinbase.vin[0].scriptSig = mapNewBlock[pdata->hashMerkleRoot].second;
  368. + pblock->vtx[0] = txCoinbase;
  369. + pblock->hashMerkleRoot = pblock->BuildMerkleTree();
  370. + //CMutableTransaction txCoinbase(*pblock->vtx[0]);
  371. + //txCoinbase.vin[0].scriptSig = mapNewBlock[pdata->hashMerkleRoot].second;
  372. + //pblock->vtx[0] = MakeTransactionRef(std::move(txCoinbase));
  373. + assert(pwalletMain != NULL);
  374. + return CheckWork(pblock, *pwalletMain, *pMiningKey);
  375. + }
  376. +}
  377.  
  378. /**
  379. * Return average network hashes per second based on the last 'lookup' blocks,
  380. @@ -130,7 +437,7 @@
  381. throw runtime_error(
  382. "getgenerate\n"
  383. "\nReturn if the server is set to generate coins or not. The default is false.\n"
  384. - "It is set with the command line argument -gen (or nos.conf setting gen)\n"
  385. + "It is set with the command line argument -gen (or solaris.conf setting gen)\n"
  386. "It can also be set with the setgenerate call.\n"
  387. "\nResult\n"
  388. "true|false (boolean) If the server is set to generate coins or not\n"
  389. @@ -446,10 +753,10 @@
  390. throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid mode");
  391.  
  392. if (vNodes.empty())
  393. - throw JSONRPCError(RPC_CLIENT_NOT_CONNECTED, "Nos is not connected!");
  394. + throw JSONRPCError(RPC_CLIENT_NOT_CONNECTED, "Nos is not connected!");
  395.  
  396. - if (IsInitialBlockDownload())
  397. - throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, "Nos is downloading blocks...");
  398. + // if (IsInitialBlockDownload())
  399. + // throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, "Nos is downloading blocks...");
  400.  
  401. static unsigned int nTransactionsUpdatedLast;
  402.  
  403. @@ -535,6 +842,8 @@
  404. // Need to update only after we know CreateNewBlock succeeded
  405. pindexPrev = pindexPrevNew;
  406. }
  407. +
  408. +
  409. CBlock* pblock = &pblocktemplate->block; // pointer for convenience
  410.  
  411. // Update nTime
  412. diff -Bur nos2/src/rpcserver.cpp NOS-Coin/src/rpcserver.cpp
  413. --- nos2/src/rpcserver.cpp 2018-05-28 11:35:46.561259142 -0400
  414. +++ NOS-Coin/src/rpcserver.cpp 2018-05-28 03:31:54.397180381 -0400
  415. @@ -2,7 +2,7 @@
  416. // Copyright (c) 2009-2014 The Bitcoin developers
  417. // Copyright (c) 2014-2015 The Dash developers
  418. // Copyright (c) 2015-2017 The PIVX developers
  419. -// Copyright (c) 2017 The Nos developers
  420. +// Copyright (c) 2017-2018 The Nos developers
  421. // Distributed under the MIT software license, see the accompanying
  422. // file COPYING or http://www.opensource.org/licenses/mit-license.php.
  423.  
  424. @@ -238,10 +238,10 @@
  425. if (fHelp || params.size() > 1)
  426. throw runtime_error(
  427. "stop\n"
  428. - "\nStop Nos server.");
  429. + "\nStop Nos server.");
  430. // Shutdown will take long enough that the response should get back
  431. StartShutdown();
  432. - return "Nos server stopping";
  433. + return "Nos server stopping";
  434. }
  435.  
  436.  
  437. @@ -282,8 +282,8 @@
  438. {"blockchain", "verifychain", &verifychain, true, false, false},
  439. {"blockchain", "invalidateblock", &invalidateblock, true, true, false},
  440. {"blockchain", "reconsiderblock", &reconsiderblock, true, true, false},
  441. -
  442. /* Mining */
  443. + {"mining", "getwork", &getwork, true, false, false},
  444. {"mining", "getblocktemplate", &getblocktemplate, true, false, false},
  445. {"mining", "getmininginfo", &getmininginfo, true, false, false},
  446. {"mining", "getnetworkhashps", &getnetworkhashps, true, false, false},
  447. @@ -291,12 +291,10 @@
  448. {"mining", "submitblock", &submitblock, true, true, false},
  449. {"mining", "reservebalance", &reservebalance, true, true, false},
  450.  
  451. -#ifdef ENABLE_WALLET
  452. /* Coin generation */
  453. {"generating", "getgenerate", &getgenerate, true, false, false},
  454. {"generating", "gethashespersec", &gethashespersec, true, false, false},
  455. {"generating", "setgenerate", &setgenerate, true, true, false},
  456. -#endif
  457.  
  458. /* Raw transactions */
  459. {"rawtransactions", "createrawtransaction", &createrawtransaction, true, false, false},
  460. @@ -318,7 +316,7 @@
  461. {"hidden", "reconsiderblock", &reconsiderblock, true, true, false},
  462. {"hidden", "setmocktime", &setmocktime, true, false, false},
  463.  
  464. - /* Nos features */
  465. + /* Nos features */
  466. {"nos", "masternode", &masternode, true, true, false},
  467. {"nos", "listmasternodes", &listmasternodes, true, true, false},
  468. {"nos", "getmasternodecount", &getmasternodecount, true, true, false},
  469. @@ -346,7 +344,6 @@
  470. {"nos", "mnsync", &mnsync, true, true, false},
  471. {"nos", "spork", &spork, true, true, false},
  472. {"nos", "getpoolinfo", &getpoolinfo, true, true, false},
  473. -#ifdef ENABLE_WALLET
  474. {"nos", "obfuscation", &obfuscation, false, false, true}, /* not threadSafe because of SendMoney */
  475.  
  476. /* Wallet */
  477. @@ -411,7 +408,6 @@
  478. {"zerocoin", "exportzerocoins", &exportzerocoins, false, false, true},
  479. {"zerocoin", "reconsiderzerocoins", &reconsiderzerocoins, false, false, true}
  480.  
  481. -#endif // ENABLE_WALLET
  482. };
  483.  
  484. CRPCTable::CRPCTable()
  485. @@ -626,7 +622,7 @@
  486. unsigned char rand_pwd[32];
  487. GetRandBytes(rand_pwd, 32);
  488. uiInterface.ThreadSafeMessageBox(strprintf(
  489. - _("To use nosd, or the -server option to nos-qt, you must set an rpcpassword in the configuration file:\n"
  490. + _("To use nosd, or the -server option to solaris-qt, you must set an rpcpassword in the configuration file:\n"
  491. "%s\n"
  492. "It is recommended you use the following random password:\n"
  493. "rpcuser=nosrpc\n"
  494. @@ -635,7 +631,7 @@
  495. "The username and password MUST NOT be the same.\n"
  496. "If the file does not exist, create it with owner-readable-only file permissions.\n"
  497. "It is also recommended to set alertnotify so you are notified of problems;\n"
  498. - "for example: alertnotify=echo %%s | mail -s \"Nos Alert\" admin@foo.com\n"),
  499. + "for example: alertnotify=echo %%s | mail -s \"Nos Alert\" admin@foo.com\n"),
  500. GetConfigFile().string(),
  501. EncodeBase58(&rand_pwd[0], &rand_pwd[0] + 32)),
  502. "", CClientUIInterface::MSG_ERROR | CClientUIInterface::SECURE);
  503. @@ -1093,7 +1089,7 @@
  504. {
  505. return "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", "
  506. "\"method\": \"" +
  507. - methodname + "\", \"params\": [" + args + "] }' -H 'content-type: text/plain;' http://127.0.0.1:7171/\n";
  508. + methodname + "\", \"params\": [" + args + "] }' -H 'content-type: text/plain;' http://127.0.0.1:51473/\n";
  509. }
  510.  
  511. const CRPCTable tableRPC;
  512. diff -Bur nos2/src/rpcserver.h NOS-Coin/src/rpcserver.h
  513. --- nos2/src/rpcserver.h 2018-05-28 11:35:46.561259142 -0400
  514. +++ NOS-Coin/src/rpcserver.h 2018-05-28 03:14:33.339453976 -0400
  515. @@ -1,6 +1,7 @@
  516. // Copyright (c) 2010 Satoshi Nakamoto
  517. // Copyright (c) 2009-2014 The Bitcoin developers
  518. // Copyright (c) 2015-2017 The PIVX developers
  519. +// Copyright (c) 2017-2018 The Nos developers
  520. // Distributed under the MIT software license, see the accompanying
  521. // file COPYING or http://www.opensource.org/licenses/mit-license.php.
  522.  
  523. @@ -96,7 +97,7 @@
  524. };
  525.  
  526. /**
  527. */
  528. class CRPCTable
  529. {
  530. @@ -172,6 +173,7 @@
  531. extern json_spirit::Value getmininginfo(const json_spirit::Array& params, bool fHelp);
  532. extern json_spirit::Value prioritisetransaction(const json_spirit::Array& params, bool fHelp);
  533. extern json_spirit::Value getblocktemplate(const json_spirit::Array& params, bool fHelp);
  534. +extern json_spirit::Value getwork(const json_spirit::Array& params, bool fHelp);
  535. extern json_spirit::Value submitblock(const json_spirit::Array& params, bool fHelp);
  536. extern json_spirit::Value estimatefee(const json_spirit::Array& params, bool fHelp);
  537. extern json_spirit::Value estimatepriority(const json_spirit::Array& params, bool fHelp);
  538. @@ -252,6 +254,7 @@
  539. extern json_spirit::Value getchaintips(const json_spirit::Array& params, bool fHelp);
  540. extern json_spirit::Value invalidateblock(const json_spirit::Array& params, bool fHelp);
  541. extern json_spirit::Value reconsiderblock(const json_spirit::Array& params, bool fHelp);
  542. +extern json_spirit::Value getinvalid(const json_spirit::Array& params, bool fHelp);
  543.  
  544. extern json_spirit::Value obfuscation(const json_spirit::Array& params, bool fHelp); // in rpcmasternode.cpp
  545. extern json_spirit::Value getpoolinfo(const json_spirit::Array& params, bool fHelp);
  546. @@ -296,4 +299,4 @@
  547. std::map<std::string, std::string>& mapHeaders,
  548. bool fRun);
  549.  
  550. -#endif // BITCOIN_RPCSERVER_H
  551. +#endif // BITCOIN_RPCSERVER_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement