- 9E438FFCC2C67D60AD299E6B1E269D00CB08A629D2E6FE169039B1FAD32421E28EF0C6286FC7E53DC5E069D6D20F715E885F83B5929849D7A997DAAF2E59AF8A
+ A5BCC482D6BAAA022DCCE82356D05947CE6FB78BE728B644A6FDD62AF44ABBC7404DEA26579645E7A33D77395B64D0D2475038EF7D5C66B8131891F6CB31956A
bitcoin/src/main.h
(164 . 14)(164 . 14)
32 std::string ToString() const
33 {
34 if (IsNull())
35 return strprintf("null");
36 return strprintf("");
37 else
38 return strprintf("(nFile=%d, nBlockPos=%d, nTxPos=%d)", nFile, nBlockPos, nTxPos);
39 return strprintf("nFile=%d,nBlockPos=%d,nTxPos=%d", nFile, nBlockPos, nTxPos);
40 }
41
42 void print() const
43 {
44 printf("%s", ToString().c_str());
45 printf(SINF SMEM "CDiskTxPos<%s>\n", ToString().c_str());
46 }
47 };
48
(222 . 12)(222 . 12)
50
51 std::string ToString() const
52 {
53 return strprintf("COutPoint(%s, %d)", hash.ToString().substr(0,10).c_str(), n);
54 return strprintf("hash=%s,n=%d", hash.ToString().c_str(), n);
55 }
56
57 void print() const
58 {
59 printf("%s\n", ToString().c_str());
60 printf(SINF SMEM "COutPoint<%s>\n", ToString().c_str());
61 }
62 };
63
(292 . 21)(292 . 19)
65 std::string ToString() const
66 {
67 std::string str;
68 str += strprintf("CTxIn(");
69 str += prevout.ToString();
70 str += strprintf("prevout=%s", prevout.ToString().c_str());
71 if (prevout.IsNull())
72 str += strprintf(", coinbase %s", HexStr(scriptSig).c_str());
73 str += strprintf(",coinbase=%s", HexStr(scriptSig).c_str());
74 else
75 str += strprintf(", scriptSig=%s", scriptSig.ToString().substr(0,24).c_str());
76 str += strprintf(",scriptSig=%s", scriptSig.ToString().c_str());
77 if (nSequence != UINT_MAX)
78 str += strprintf(", nSequence=%u", nSequence);
79 str += ")";
80 str += strprintf(",nSequence=%u", nSequence);
81 return str;
82 }
83
84 void print() const
85 {
86 printf("%s\n", ToString().c_str());
87 printf(SINF SMEM "CTxIn<%s>\n", ToString().c_str());
88 }
89 };
90
(370 . 13)(368 . 14)
92 std::string ToString() const
93 {
94 if (scriptPubKey.size() < 6)
95 return "CTxOut(error)";
96 return strprintf("CTxOut(nValue=%"PRI64d".%08"PRI64d", scriptPubKey=%s)", nValue / COIN, nValue % COIN, scriptPubKey.ToString().substr(0,30).c_str());
97 return "error";
98 return strprintf("nValue=%"PRI64d".%08"PRI64d",scriptPubKey=%s",
99 nValue / COIN, nValue % COIN, scriptPubKey.ToString().c_str());
100 }
101
102 void print() const
103 {
104 printf("%s\n", ToString().c_str());
105 printf(SINF SMEM "CTxOut<%s>\n", ToString().c_str());
106 }
107 };
108
(609 . 22)(608 . 20)
110 std::string ToString() const
111 {
112 std::string str;
113 str += strprintf("CTransaction(hash=%s, ver=%d, vin.size=%d, vout.size=%d, nLockTime=%d)\n",
114 GetHash().ToString().substr(0,10).c_str(),
115 nVersion,
116 vin.size(),
117 vout.size(),
118 nLockTime);
119 str += strprintf("hash=%s,ver=%d,vin.size=%d,vout.size=%d,nLockTime=%d,vin={",
120 GetHash().ToString().c_str(), nVersion, vin.size(), vout.size(), nLockTime);
121 for (int i = 0; i < vin.size(); i++)
122 str += " " + vin[i].ToString() + "\n";
123 str += "CTxIn<" + vin[i].ToString() + ">" + (i == vin.size() - 1 ? "" : ",");
124 str += "},vout={";
125 for (int i = 0; i < vout.size(); i++)
126 str += " " + vout[i].ToString() + "\n";
127 str += "CTxOut<" + vout[i].ToString() + ">" + (i == vout.size() - 1 ? "" : ",");
128 str += "}";
129 return str;
130 }
131
132 void print() const
133 {
134 printf("%s", ToString().c_str());
135 printf(SINF SMEM "CTransaction<%s>\n", ToString().c_str());
136 }
137
138
(946 . 31)(943 . 26)
140
141 // Check the header
142 if (!CheckProofOfWork(GetHash(), nBits))
143 return error("CBlock::ReadFromDisk() : errors in block header");
144 return error(SBLK "failure reading block file %d from disk due errors on block header", nFile);
145
146 return true;
147 }
148
149
150 std::string ToString() const
151 {
152 std::string str;
153 str += strprintf("hash=%s,ver=%d,hashPrevBlock=%s,hashMerkleRoot=%s,nTime=%u,nBits=%08x,nNonce=%u,vtx={",
154 GetHash().ToString().c_str(), nVersion, hashPrevBlock.ToString().c_str(),
155 hashMerkleRoot.ToString().c_str(), nTime, nBits, nNonce, vtx.size());
156 for (int i = 0; i < vtx.size(); i++)
157 str += strprintf("CTransaction<%s>%s", vtx[i].ToString().c_str(), i == vtx.size() - 1 ? "" : ",");
158 str += "}";
159 return str;
160 }
161
162 void print() const
163 {
164 printf("CBlock(hash=%s, ver=%d, hashPrevBlock=%s, hashMerkleRoot=%s, nTime=%u, nBits=%08x, nNonce=%u, vtx=%d)\n",
165 GetHash().ToString().substr(0,20).c_str(),
166 nVersion,
167 hashPrevBlock.ToString().substr(0,20).c_str(),
168 hashMerkleRoot.ToString().substr(0,10).c_str(),
169 nTime, nBits, nNonce,
170 vtx.size());
171 for (int i = 0; i < vtx.size(); i++)
172 {
173 printf(" ");
174 vtx[i].print();
175 }
176 printf(" vMerkleTree: ");
177 for (int i = 0; i < vMerkleTree.size(); i++)
178 printf("%s ", vMerkleTree[i].ToString().substr(0,10).c_str());
179 printf("\n");
180 printf(SINF SBLK "CBlock<%s>\n", ToString().c_str());
181 }
182
183
(1138 . 15)(1130 . 14)
185
186 std::string ToString() const
187 {
188 return strprintf("CBlockIndex(nprev=%08x, pnext=%08x, nFile=%d, nBlockPos=%-6d nHeight=%d, merkle=%s, hashBlock=%s)",
189 pprev, pnext, nFile, nBlockPos, nHeight,
190 hashMerkleRoot.ToString().substr(0,10).c_str(),
191 GetBlockHash().ToString().substr(0,20).c_str());
192 return strprintf("nprev=%08x,pnext=%08x,nFile=%d,nBlockPos=%-6d,nHeight=%d,merkle=%s,hashBlock=%s",
193 pprev, pnext, nFile, nBlockPos, nHeight, hashMerkleRoot.ToString().c_str(),
194 GetBlockHash().ToString().c_str());
195 }
196
197 void print() const
198 {
199 printf("%s\n", ToString().c_str());
200 printf(SINF SBLK "CBlockIndex<%s>\n", ToString().c_str());
201 }
202 };
203
(1207 . 18)(1198 . 17)
205
206 std::string ToString() const
207 {
208 std::string str = "CDiskBlockIndex(";
209 std::string str;
210 str += CBlockIndex::ToString();
211 str += strprintf("\n hashBlock=%s, hashPrev=%s, hashNext=%s)",
212 GetBlockHash().ToString().c_str(),
213 hashPrev.ToString().substr(0,20).c_str(),
214 hashNext.ToString().substr(0,20).c_str());
215 str += strprintf("%s,hashBlock=%s,hashPrev=%s,hashNext=%s",
216 CBlockIndex::ToString().c_str(), GetBlockHash().ToString().c_str(),
217 hashPrev.ToString().c_str(), hashNext.ToString().c_str());
218 return str;
219 }
220
221 void print() const
222 {
223 printf("%s\n", ToString().c_str());
224 printf(SINF SBLK "CDiskBlockIndex<%s>\n", ToString().c_str());
225 }
226 };
227