Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. UniValue arr(UniValue::VARR);
  2. for (int i = 0; i < request.params[0].get_int(); i++) {
  3. std::unique_ptr<CBlockTemplate> pblocktemplate(BlockAssembler(Params()).CreateNewBlock(coinbaseDest));
  4. if (!pblocktemplate.get())
  5. throw JSONRPCError(RPC_INTERNAL_ERROR, "Wallet keypool empty");
  6. unsigned int nExtraNonce = 0;
  7. IncrementExtraNonce(&pblocktemplate->block, chainActive.Tip(), nExtraNonce);
  8. if (!CheckProof(pblocktemplate->block, Params().GetConsensus()))
  9. throw JSONRPCError(RPC_METHOD_NOT_FOUND, "This method cannot be used with a block-signature-required chain");
  10. std::shared_ptr<const CBlock> shared_pblock = std::make_shared<const CBlock>(pblocktemplate->block);
  11. bool ret;
  12. ret = ProcessNewBlock(Params(), shared_pblock, true, NULL);
  13. assert(ret);
  14. assert(chainActive.Tip()->GetBlockHash() == pblocktemplate->block.GetHash());
  15. arr.push_back(pblocktemplate->block.GetHash().ToString());
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement