janoside / btc-rpc-explorer

Database-free, self-hosted Bitcoin explorer, via RPC to Bitcoin Core.
https://bitcoinexplorer.org
MIT License
1.52k stars 1.13k forks source link

Patoshi wrongly identified by block height on testchains #406

Closed jsarenik closed 2 years ago

jsarenik commented 2 years ago

Describe the bug

An explorer for Signet is showing Patoshi as the miner just because of the known block height. See https://signet.bitcoinexplorer.org/block-height/3

Such miner identifications could be rather network-specific.

Environment (please complete the following information):

See the Dashboard at https://ex.plebnet.bublina.eu.org/admin/dashboard for any details.

Configuration file content

Please include the content from the following files. BE SURE TO MODIFY YOUR CREDENTIALS BEFORE SUBMITTING!!!

onlynet=ipv4
onlynet=onion
onlynet=ygg
yggdrasilreachable=1
txindex=1
constatsindex=1
blockfilterindex=1

[signet]
port=12346
bind=[300:5ecb:6b8a:d837::3]:12346
rpcport=11234
signetchallenge=512102ee856c56a5aaadd1656f849bafa4c9dacc86a2878fe546c6189185f842ae2c1851ae
addnode=104.131.10.218
addnode=6megrst422lxzsqvshkqkg6z2zhunywhyrhy3ltezaeyfspfyjdzr3qd.onion
rpcauth=somethinggreathere

To Reproduce

Steps to reproduce the behavior:

  1. Go to https://signet.bitcoinexplorer.org/block-height/3
  2. See the Miner identified as Patoshi.
jsarenik commented 2 years ago

Works for me with following patch:

diff --git a/app/utils.js b/app/utils.js
index 31e4d6f..4ce4dbf 100644
--- a/app/utils.js
+++ b/app/utils.js
@@ -514,7 +514,7 @@ function identifyMiner(coinbaseTx, blockHeight) {
                                }
                        }

-                       if (miningPoolsConfig.block_heights) {
+                       if (global.activeBlockchain == "main" && miningPoolsConfig.block_heights) {
                                for (var minerName in miningPoolsConfig.block_heights) {
                                        var minerInfo = miningPoolsConfig.block_heights[minerName];
                                        minerInfo.name = minerName;
jsarenik commented 2 years ago

@janoside What do you think about this patch? ^^ Shall I make a PR of it?

jsarenik commented 2 years ago

The explorers already running with the change (and a few unrelated others) are: