tree checksum vpatch file split hunks
all signers: mod6
antecedents: mod6_excise_hash_truncation
press order:
patch:
(11 . 7)(11 . 7)- 0971A01F7FA9F4D6209A769A8D5249AFAC1E458907C031626EE764B6F85416AEDA8DE595E8F18F3E9968D7E699F35259BC833BBA1D88C14DDB26D29AFD45C7FB
5 542413 asciilifeform_zap_hardcoded_seeds asciilifeform Remove hardcoded node seeds
6 542413 bitcoin-v0_5_3_1-static_makefile_v002.8 mod6 Add static makefile options
7 542413 asciilifeform-kills-integer-retardation asciilifeform Fix integer type problems
8 542413 asciilifeform_zap_showmyip_crud asciilifeform Abolishes the 'showmyip.com' idiocy; prerequisite for the total removal of all instances of DNS invocation
9 542413 asciilifeform_zap_showmyip_crud asciilifeform Abolishes the 'showmyip.com' idiocy; Prerequisite for the total removal of all instances of DNS invocation
10 542413 bitcoin-v0_5_3_1-rev_bump ben_vulpes Bump version number to 0.5.3.1
11 542413 asciilifeform_and_now_we_have_block_dumper_corrected asciilifeform Add 'dumpblock' RPC command
12 542413 asciilifeform_dns_thermonyukyoolar_kleansing asciilifeform Abolishes all invocations of DNS
(26 . 8)(26 . 9)
14 542413 mod6_der_high_low_s mod6 Add command-line flags to set Low-S or High-S
15 542413 makefiles mod6 Add makefiles to build entire TRB
16 542413 asciilifeform_aggressive_pushgetblocks asciilifeform Issue PushGetBlocks command to any peer that issues 'version' command
17 614342 trb_keccak_regrind mod6 Not a vpatch, whole TRB tree keccak regrind; removes UTF-8 char from original genesis.vpatch
18 614347 mod6_privkey_tools.vpatch mod6 adds privkey tools
19 614351 mod6_manifest.vpatch mod6 Adds TRB manifest; updates version comments
20 616451 mod6_phexdigit_fix.vpatch mod6 Adds missing comma to separate values in the phexdigit array in util.cpp.
21 617254 mod6_excise_hash_truncation mod6 Regrind of ben_vulpes original; removes truncation of hashes printed to TRB log file
22 614342 trb_keccak_regrind mod6 Not a vpatch, whole TRB tree keccak regrind; Also removes UTF-8 char from original genesis.vpatch
23 614347 mod6_privkey_tools mod6 Adds privkey tools
24 614351 mod6_manifest mod6 Adds TRB manifest; Updates version comments
25 616451 mod6_phexdigit_fix mod6 Adds missing comma to separate values in the phexdigit array in util.cpp.
26 617254 mod6_excise_hash_truncation mod6 Regrind of ben_vulpes original; Removes truncation of hashes printed to TRB log file
27 617255 mod6_whogaveblox mod6 Regrind of asciilifeform original; Record the origin of every incoming candidate block (whether accepted or rejected)
(1322 . 14)(1322 . 25)
32
33 bool ProcessBlock(CNode* pfrom, CBlock* pblock)
34 {
35 // Whose block we are trying.
36 string peer_ip;
37
38 if (pfrom != NULL) {
39 peer_ip = pfrom->addr.ToStringIP(); // if candidate block came from a peer
40 } else {
41 peer_ip = "LOCAL"; // if it came from, e.g., EatBlock
42 }
43
44 // Check for duplicate
45 uint256 hash = pblock->GetHash();
46 if (mapBlockIndex.count(hash))
47 return error("ProcessBlock() : already have block %d %s", mapBlockIndex[hash]->nHeight, hash.ToString().c_str());
48 return error("ProcessBlock() : already have block %d %s from peer %s",
49 mapBlockIndex[hash]->nHeight, hash.ToString().c_str(),
50 peer_ip.c_str());
51
52 // Preliminary checks
53 if (!pblock->CheckBlock())
54 return error("ProcessBlock() : CheckBlock FAILED");
55 return error("ProcessBlock() : CheckBlock FAILED from peer %s", peer_ip.c_str());
56
57 CBlockIndex* pcheckpoint = Checkpoints::GetLastCheckpoint(mapBlockIndex);
58 if (pcheckpoint && pblock->hashPrevBlock != hashBestChain)
(1340 . 7)(1351 . 8)
60 {
61 if (pfrom)
62 pfrom->Misbehaving(100);
63 return error("ProcessBlock() : block with timestamp before last checkpoint");
64 return error("ProcessBlock() : block with timestamp before last checkpoint from peer %s",
65 peer_ip.c_str());
66 }
67 CBigNum bnNewBlock;
68 bnNewBlock.SetCompact(pblock->nBits);
(1350 . 14)(1362 . 17)
70 {
71 if (pfrom)
72 pfrom->Misbehaving(100);
73 return error("ProcessBlock() : block with too little proof-of-work");
74 return error("ProcessBlock() : block with too little proof-of-work from peer %s",
75 peer_ip.c_str());
76 }
77 }
78
79 // If don't already have its previous block, throw it out!
80 if (!mapBlockIndex.count(pblock->hashPrevBlock))
81 {
82 printf("ProcessBlock: BASTARD BLOCK, prev=%s, DISCARDED\n", pblock->hashPrevBlock.ToString().c_str());
83 printf("ProcessBlock: BASTARD BLOCK, prev=%s, DISCARDED from peer %s\n",
84 pblock->hashPrevBlock.ToString().c_str(),
85 peer_ip.c_str());
86
87 // Ask this guy to fill in what we're missing
88 if (pfrom)
(1368 . 9)(1383 . 11)
90
91 // Store to disk
92 if (!pblock->AcceptBlock())
93 return error("ProcessBlock() : AcceptBlock FAILED");
94
95 printf("ProcessBlock: ACCEPTED\n");
96 return error("ProcessBlock() : AcceptBlock FAILED from peer %s", peer_ip.c_str());
97
98 printf("ProcessBlock: ACCEPTED block %s from: %s\n",
99 hash.ToString().c_str(), peer_ip.c_str());
100
101 return true;
102 }
103