trb

trb
Log | Files | Refs

commit 9bec3ecc7a17f508305f7ada190dbe9e24b81aed
parent d0f3f5edabc74d8e017b82c7a2211009a88cb6da
Author: Shinoa-Fores <btcinfo@sdf.org>
Date:   Wed, 13 Jan 2021 17:41:37 -0500

mod6_whogaveblox.vpatch

Diffstat:
Mbitcoin/manifest | 13+++++++------
Mbitcoin/src/main.cpp | 33+++++++++++++++++++++++++--------
2 files changed, 32 insertions(+), 14 deletions(-)

diff --git a/bitcoin/manifest b/bitcoin/manifest @@ -11,7 +11,7 @@ 542413 asciilifeform_zap_hardcoded_seeds asciilifeform Remove hardcoded node seeds 542413 bitcoin-v0_5_3_1-static_makefile_v002.8 mod6 Add static makefile options 542413 asciilifeform-kills-integer-retardation asciilifeform Fix integer type problems -542413 asciilifeform_zap_showmyip_crud asciilifeform Abolishes the 'showmyip.com' idiocy; prerequisite for the total removal of all instances of DNS invocation +542413 asciilifeform_zap_showmyip_crud asciilifeform Abolishes the 'showmyip.com' idiocy; Prerequisite for the total removal of all instances of DNS invocation 542413 bitcoin-v0_5_3_1-rev_bump ben_vulpes Bump version number to 0.5.3.1 542413 asciilifeform_and_now_we_have_block_dumper_corrected asciilifeform Add 'dumpblock' RPC command 542413 asciilifeform_dns_thermonyukyoolar_kleansing asciilifeform Abolishes all invocations of DNS @@ -26,8 +26,9 @@ 542413 mod6_der_high_low_s mod6 Add command-line flags to set Low-S or High-S 542413 makefiles mod6 Add makefiles to build entire TRB 542413 asciilifeform_aggressive_pushgetblocks asciilifeform Issue PushGetBlocks command to any peer that issues 'version' command -614342 trb_keccak_regrind mod6 Not a vpatch, whole TRB tree keccak regrind; removes UTF-8 char from original genesis.vpatch -614347 mod6_privkey_tools.vpatch mod6 adds privkey tools -614351 mod6_manifest.vpatch mod6 Adds TRB manifest; updates version comments -616451 mod6_phexdigit_fix.vpatch mod6 Adds missing comma to separate values in the phexdigit array in util.cpp. -617254 mod6_excise_hash_truncation mod6 Regrind of ben_vulpes original; removes truncation of hashes printed to TRB log file +614342 trb_keccak_regrind mod6 Not a vpatch, whole TRB tree keccak regrind; Also removes UTF-8 char from original genesis.vpatch +614347 mod6_privkey_tools mod6 Adds privkey tools +614351 mod6_manifest mod6 Adds TRB manifest; Updates version comments +616451 mod6_phexdigit_fix mod6 Adds missing comma to separate values in the phexdigit array in util.cpp. +617254 mod6_excise_hash_truncation mod6 Regrind of ben_vulpes original; Removes truncation of hashes printed to TRB log file +617255 mod6_whogaveblox mod6 Regrind of asciilifeform original; Record the origin of every incoming candidate block (whether accepted or rejected) diff --git a/bitcoin/src/main.cpp b/bitcoin/src/main.cpp @@ -1322,14 +1322,25 @@ bool CBlock::AcceptBlock() bool ProcessBlock(CNode* pfrom, CBlock* pblock) { + // Whose block we are trying. + string peer_ip; + + if (pfrom != NULL) { + peer_ip = pfrom->addr.ToStringIP(); // if candidate block came from a peer + } else { + peer_ip = "LOCAL"; // if it came from, e.g., EatBlock + } + // Check for duplicate uint256 hash = pblock->GetHash(); if (mapBlockIndex.count(hash)) - return error("ProcessBlock() : already have block %d %s", mapBlockIndex[hash]->nHeight, hash.ToString().c_str()); + return error("ProcessBlock() : already have block %d %s from peer %s", + mapBlockIndex[hash]->nHeight, hash.ToString().c_str(), + peer_ip.c_str()); // Preliminary checks if (!pblock->CheckBlock()) - return error("ProcessBlock() : CheckBlock FAILED"); + return error("ProcessBlock() : CheckBlock FAILED from peer %s", peer_ip.c_str()); CBlockIndex* pcheckpoint = Checkpoints::GetLastCheckpoint(mapBlockIndex); if (pcheckpoint && pblock->hashPrevBlock != hashBestChain) @@ -1340,7 +1351,8 @@ bool ProcessBlock(CNode* pfrom, CBlock* pblock) { if (pfrom) pfrom->Misbehaving(100); - return error("ProcessBlock() : block with timestamp before last checkpoint"); + return error("ProcessBlock() : block with timestamp before last checkpoint from peer %s", + peer_ip.c_str()); } CBigNum bnNewBlock; bnNewBlock.SetCompact(pblock->nBits); @@ -1350,14 +1362,17 @@ bool ProcessBlock(CNode* pfrom, CBlock* pblock) { if (pfrom) pfrom->Misbehaving(100); - return error("ProcessBlock() : block with too little proof-of-work"); + return error("ProcessBlock() : block with too little proof-of-work from peer %s", + peer_ip.c_str()); } } // If don't already have its previous block, throw it out! if (!mapBlockIndex.count(pblock->hashPrevBlock)) { - printf("ProcessBlock: BASTARD BLOCK, prev=%s, DISCARDED\n", pblock->hashPrevBlock.ToString().c_str()); + printf("ProcessBlock: BASTARD BLOCK, prev=%s, DISCARDED from peer %s\n", + pblock->hashPrevBlock.ToString().c_str(), + peer_ip.c_str()); // Ask this guy to fill in what we're missing if (pfrom) @@ -1368,9 +1383,11 @@ bool ProcessBlock(CNode* pfrom, CBlock* pblock) // Store to disk if (!pblock->AcceptBlock()) - return error("ProcessBlock() : AcceptBlock FAILED"); - - printf("ProcessBlock: ACCEPTED\n"); + return error("ProcessBlock() : AcceptBlock FAILED from peer %s", peer_ip.c_str()); + + printf("ProcessBlock: ACCEPTED block %s from: %s\n", + hash.ToString().c_str(), peer_ip.c_str()); + return true; }