- 4731466A24920C9320DC9F20D9537058DD693DA77B8646A3CC47A69D710217574452A18A45D81DE82231246FD402D7F80FCA14AA85EE14156FFA513E064BFC81
+ E3D08B1607A11BE7B3ABD68BDBD93CAA378C614C8855EE21BC6E1D8537E443C6F1D496BB9C86F240231065AD226A09F7F8288BB79923075492A2166A87F6DDCB
bitcoin/src/bitcoinrpc.cpp
(1817 . 6)(1817 . 28)
5 }
6
7
8 Value eatblock(const Array& params, bool fHelp)
9 {
10 if (fHelp || params.size() < 1 || params.size() > 1)
11 throw runtime_error(
12 "eatblock <filename>\n"
13 "Load a candidate for the next block directly from <filename>.");
14
15 if (!fCanEat)
16 throw runtime_error(
17 "'eatblock' is only permitted if bitcoind was started with -caneat flag!");
18
19 // path to load block from
20 string filename = params[0].get_str();
21
22 printf("Attempting to create block #%d from file %s\n", nBestHeight + 1, filename.c_str());
23 CAutoFile filein = fopen(filename.c_str(), "rb");
24 CBlock block;
25 filein >> block;
26 return ProcessBlock(NULL, &block); // note that 'true' even if it was rejected (bastard, etc)
27 } // ... but will return 'false' if we already have the block.
28
29
30
31 //
32 // Call Table
(1865 . 6)(1887 . 7)
34 make_pair("getmemorypool", &getmemorypool),
35 make_pair("listsinceblock", &listsinceblock),
36 make_pair("dumpblock", &dumpblock),
37 make_pair("eatblock", &eatblock),
38 };
39 map<string, rpcfn_type> mapCallTable(pCallTable, pCallTable + sizeof(pCallTable)/sizeof(pCallTable[0]));
40