janoside / btc-rpc-explorer

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

QR code of address does not show #499

Closed carnhofdaki closed 1 year ago

carnhofdaki commented 1 year ago

Describe the bug

Half of the times the QR code for address tb1qchffkc20t82tk5akyhjn2524sh9kk24fyf495x (and many others, this is just an example) does not show.

Environment (please complete the following information):

See at bitcoinexplorer.org

Configuration file content

The configuration of bitcoinexplorer.org

To Reproduce

Steps to reproduce the behavior:

  1. Go to https://signet.bitcoinexplorer.org/address/tb1qchffkc20t82tk5akyhjn2524sh9kk24fyf495x
  2. If you can see the QR code, just refresh (CTRL+R) until it disappears
  3. See missing QR code

Screenshots or Log Output

Inspecting the element, I see that the QR code does not show when the resulting HTML received by the browser contains

<div class="float-start float-md-end mb-3 mb-md-0">
<img alt="tb1qchffkc20t82tk5akyhjn2524sh9kk24fyf495x" style="border: 1px solid rgb(204, 204, 204); --darkreader-inline-border-top:#3e4446; --darkreader-inline-border-right:#3e4446; --darkreader-inline-border-bottom:#3e4446; --darkreader-inline-border-left:#3e4446;" data-darkreader-inline-border-top="" data-darkreader-inline-border-right="" data-darkreader-inline-border-bottom="" data-darkreader-inline-border-left="">
</div>

But after a (couple of) refresh the QR shows when the HTML contains this:

<div class="float-start float-md-end mb-3 mb-md-0">
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJQAAACUCAYAAAB1PADUAAAAAklEQVR4AewaftIAAATXSURBVO3BQY4bSRAEwfAC//9l3znmqYBGJ2clIczwR6qWnFQtOqladFK16KRq0UnVopOqRSdVi06qFp1ULTqpWnRSteikatFJ1aKTqkUnVYs+eQnIb1JzA+RGzQ2QGzUTkE1qJiC/Sc0bJ1WLTqoWnVQt+mSZmk1AnlAzAXlCzQ2QSc0E5EbNG2o2Adl0UrXopGrRSdWiT74MyBNqngAyqbkBMqm5ATKpmYBMaiYg3wTkCTXfdFK16KRq0UnVok/+MUCeAPIEkEnNBGR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AbNU8AeUPNBOQ3nVQtOqladFK16JN/DJBJzQRkk5ongNyoeQPIpGYC8k0nVYtOqhadVC365B+j5kbNDZAn1ExAbtRMQG6APKFmAnKjZtNJ1aKTqkUnVYs++TI136TmCSBPqJmA3KjZpGYCMqmZgExqJiDfdFK16KRq0UnVIvyRF4D8JjUTkBs1N0AmNROQSc0NkEnNBGRSMwGZ1LwBZFLzTSdVi06qFp1ULcIfqVpyUrXopGrRSdWik6pFJ1WLTqoWnVQtOqladFK16KRq0UnVopOqRSdVi06qFp1ULfoPddM6QUZMqvoAAAAASUVORK5CYII=" alt="tb1qchffkc20t82tk5akyhjn2524sh9kk24fyf495x" style="border: 1px solid rgb(204, 204, 204); --darkreader-inline-border-top:#3e4446; --darkreader-inline-border-right:#3e4446; --darkreader-inline-border-bottom:#3e4446; --darkreader-inline-border-left:#3e4446;" data-darkreader-inline-border-top="" data-darkreader-inline-border-right="" data-darkreader-inline-border-bottom="" data-darkreader-inline-border-left="">
</div>

After another couple of refreshes, the QR code again does not show. The broken image icon is shown inside the image bordered space and contains the address.

If applicable, add screenshots or log output to help explain your problem.

Screenshot when it's not showing: btc-rpc-explorer-qrnono

Additional context

It behaves the same on mainnet bitcoinexplorer.org or be.anyone.eu.org (or for signet https://ex.signet.bublina.eu.org/)

Browser is a current version of Google Chrome.

carnhofdaki commented 1 year ago

And it's the same with DarkReader extension turned off:

Not working:

<div class="float-start float-md-end mb-3 mb-md-0">
<img alt="tb1qchffkc20t82tk5akyhjn2524sh9kk24fyf495x" style="border: solid 1px #ccc;">
</div>

Working (after refresh):

<div class="float-start float-md-end mb-3 mb-md-0">
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJQAAACUCAYAAAB1PADUAAAAAklEQVR4AewaftIAAATXSURBVO3BQY4bSRAEwfAC//9l3znmqYBGJ2clIczwR6qWnFQtOqladFK16KRq0UnVopOqRSdVi06qFp1ULTqpWnRSteikatFJ1aKTqkUnVYs+eQnIb1JzA+RGzQ2QGz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JmATGpugExq3jipWnRSteikatEnLwH5TWomNROQCcikZgIyqbkB8puATGpu1ExAJjWTmk0nVYtOqhadVC36ZJmaTUBugExqJiATkEnNG2pugExqJiA3ap4AMqmZgNyoeeOkatFJ1aKTqkWffBmQJ9T8JiCTmhs1E5AbNU8AeUPNBOQ3nVQtOqladFK16JN/DJBJzQRkk5ongNyoeQPIpGYC8k0nVYtOqhadVC365B+j5kbNDZAn1ExAbtRMQG6APKFmAnKjZtNJ1aKTqkUnVYs++TI136TmCSBPqJmA3KjZpGYCMqmZgExqJiDfdFK16KRq0UnVIvyRF4D8JjUTkBs1N0AmNROQSc0NkEnNBGRSMwGZ1LwBZFLzTSdVi06qFp1ULcIfqVpyUrXopGrRSdWik6pFJ1WLTqoWnVQtOqladFK16KRq0UnVopOqRSdVi06qFp1ULfoPddM6QUZMqvoAAAAASUVORK5CYII=" alt="tb1qchffkc20t82tk5akyhjn2524sh9kk24fyf495x" style="border: solid 1px #ccc;">
</div>
carnhofdaki commented 1 year ago

Another finding is that the QR code always shows for addresses which are known (by the queried Electrum server) to have been used:

carnhofdaki commented 1 year ago

So I guess it would be some race condition.

carnhofdaki commented 1 year ago

@janoside please have a look at this issue