tree checksum vpatch file split hunks
all signers: mod6
antecedents: asciilifeform-kills-integer-retardation
press order:
patch:
(1782 . 12)(1782 . 39)
5 }
6
7
8
9
10
11
12
13
14 Value dumpblock(const Array& params, bool fHelp)
15 {
16 if (fHelp || params.size() < 1 || params.size() > 2)
17 throw runtime_error(
18 "dumpblock <height> <filename>\n"
19 "Emit the block at <height> to <filename>.");
20
21 int want_height = 0;
22 if (params.size() > 0)
23 want_height = params[0].get_int();
24
25 if (want_height > nBestHeight)
26 throw runtime_error("Requested block exceeds current nBestHeight!\n");
27
28 // path to dump block to
29 string filename = params[1].get_str();
30
31 // this is O(n^2)...
32 // possibly could be improved if we descend from best height if requested height is closer to it
33 for (map<uint256, CBlockIndex*>::iterator mi = mapBlockIndex.begin(); mi != mapBlockIndex.end(); ++mi)
34 {
35 CBlockIndex *pindex = (*mi).second;
36 if (pindex->nHeight == want_height) {
37 CBlock block;
38 block.ReadFromDisk(pindex);
39 printf("Dumping block %d to %s\n", want_height, filename.c_str());
40 CAutoFile fileout = fopen(filename.c_str(), "wb+");
41 fileout << block;
42 return true;
43 }
44 }
45 return false;
46 }
47
48
49
(1837 . 6)(1864 . 7)
51 make_pair("settxfee", &settxfee),
52 make_pair("getmemorypool", &getmemorypool),
53 make_pair("listsinceblock", &listsinceblock),
54 make_pair("dumpblock", &dumpblock),
55 };
56 map<string, rpcfn_type> mapCallTable(pCallTable, pCallTable + sizeof(pCallTable)/sizeof(pCallTable[0]));
57
(1863 . 6)(1891 . 7)
59 "validateaddress",
60 "getwork",
61 "getmemorypool",
62 "dumpblock",
63 };
64 set<string> setAllowInSafeMode(pAllowInSafeMode, pAllowInSafeMode + sizeof(pAllowInSafeMode)/sizeof(pAllowInSafeMode[0]));
65
(2364 . 6)(2393 . 7)
67 if (strMethod == "listaccounts" && n > 0) ConvertTo<boost::int64_t>(params[0]);
68 if (strMethod == "walletpassphrase" && n > 1) ConvertTo<boost::int64_t>(params[1]);
69 if (strMethod == "listsinceblock" && n > 1) ConvertTo<boost::int64_t>(params[1]);
70 if (strMethod == "dumpblock" && n > 0) ConvertTo<boost::int64_t>(params[0]);
71 if (strMethod == "sendmany" && n > 1)
72 {
73 string s = params[1].get_str();