From 00bd711501291e66b3b3ef818b443de966b39d47 Mon Sep 17 00:00:00 2001 From: DcruBro Date: Fri, 29 May 2026 14:31:24 +0200 Subject: [PATCH] remove proof --- src/block/chain.c | 30 +----------------------------- src/main.c | 16 +--------------- 2 files changed, 2 insertions(+), 44 deletions(-) diff --git a/src/block/chain.c b/src/block/chain.c index 0f910a6..7841128 100644 --- a/src/block/chain.c +++ b/src/block/chain.c @@ -345,35 +345,7 @@ bool Chain_AddBlock(blockchain_t* chain, block_t* block) { printf("Added new block to chain:\n"); Block_ShortPrint(block); - // After adding block, print a simple mathematical 'proof' that fees were included - { - uint64_t coinbaseAmount = 0; - uint64_t totalFees = 0; - if (block->transactions) { - for (size_t i = 0; i < DynArr_size(block->transactions); ++i) { - signed_transaction_t* tx = (signed_transaction_t*)DynArr_at(block->transactions, i); - if (!tx) { continue; } - if (Address_IsCoinbase(tx->transaction.senderAddress)) { - coinbaseAmount = tx->transaction.amount1; - } else { - if (UINT64_MAX - totalFees >= tx->transaction.fee) { - totalFees += tx->transaction.fee; - } - } - } - } - - uint64_t base = currentReward; - if (coinbaseAmount > 0 || totalFees > 0) { - printf("Proof: coinbase(%llu) == baseReward(%llu) + totalFees(%llu) => %llu == %llu + %llu\n", - (unsigned long long)coinbaseAmount, - (unsigned long long)base, - (unsigned long long)totalFees, - (unsigned long long)coinbaseAmount, - (unsigned long long)base, - (unsigned long long)totalFees); - } - } + /* Debug proof removed: coinbase == baseReward + totalFees was printed here during debugging. */ return ok; } diff --git a/src/main.c b/src/main.c index 9ccd580..92fab1b 100644 --- a/src/main.c +++ b/src/main.c @@ -429,21 +429,7 @@ static bool MineAndAppendBlock(blockchain_t* chain, } } - // Print mathematical proof that fees are included in the coinbase payout for miner visibility. - { - uint64_t cb = 0; - uint64_t fees = 0; - if (Block_GetCoinbaseAndFeeTotals(block, &cb, &fees)) { - uint64_t base = *currentReward; - printf("Mined block proof: coinbase(%llu) == baseReward(%llu) + totalFees(%llu) => %llu == %llu + %llu\n", - (unsigned long long)cb, - (unsigned long long)base, - (unsigned long long)fees, - (unsigned long long)cb, - (unsigned long long)base, - (unsigned long long)fees); - } - } + /* Debug proof removed: miner printed proof that coinbase == baseReward + totalFees during debugging. */ // After successfully appending a block, attempt to attach any orphans. size_t attached = OrphanPool_AttemptAttach(chain);