- CD1DCC5FEBDDD45408B193D0B875D8951EED8DC29D342AE5E57330B4EA2B55D959FAB19E634696234C698FEB4FA79A5702278E83B3896389C425ADA5E935CC34
+ 86E836B4710A5F675AF7F13832F290F9B9C9F24D3EFB41733D55E3A4F3F518E8C9FB1D60B43A2FBA3C8327BD2B9D10E5EBBB6DF8159F06873AEC21D2B9123304
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