Bitcoin Forum
May 06, 2024, 10:03:32 PM
Welcome,
Guest
. Please
login
or
register
.
News
: Latest Bitcoin Core release:
27.0
[
Torrent
]
Home
Help
Search
Login
Register
More
Bitcoin Forum
>
Bitcoin
>
Development & Technical Discussion
>
Can this fix a Problematic block in Bitcoin Core?
Pages: [
1
]
« previous topic
next topic »
Print
Author
Topic: Can this fix a Problematic block in Bitcoin Core? (Read 158 times)
Davidvictorson
(OP)
Hero Member
Online
Activity: 980
Merit: 833
Livecasino.io
Can this fix a Problematic block in Bitcoin Core?
June 05, 2023, 08:40:38 AM
#1
Let me paint a scenario: if I am running a Python script and notice an error in the output, I simply locate the line where the error occurs, make the necessary corrections, and then rerun the script.
Now, assuming that the Python script in question is Bitcoin Core 25.0, and I notice an error in a line or a block. Just like in a Python script, if I rewrite the problematic block (assuming I am able to do so) and rerun the script, would it work?
PS: Please pardon my Python script scenario. I know it may not be the best scenario to paint here in this case but it is just how my brain is trying to process it for easier understanding.
██
██
██
██
██
██
██
██
██
██
██
██
██
...
⬤
⬤
LIVECASINO
.io
│
P
l
a
y
L
i
v
e
G
a
m
e
s
w
i
t
h
u
p
t
o
20%
c
a
s
h
b
a
c
k
!
...
██
██
██
██
██
██
██
██
██
██
██
██
██
1715033012
Hero Member
Offline
Posts: 1715033012
Ignore
1715033012
1715033012
#2
1715033012
Report to moderator
Bitcoin addresses contain a checksum, so it is very unlikely that mistyping an address will cause you to lose money.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715033012
Hero Member
Offline
Posts: 1715033012
Ignore
1715033012
1715033012
#2
1715033012
Report to moderator
un_rank
Hero Member
Offline
Activity: 714
Merit: 684
- Jay -
Re: Can this fix a Problematic block in Bitcoin Core?
June 05, 2023, 08:50:55 AM
Merited
by
vapourminer
(1)
#2
You will have to provide some more information like what sort of error you can notice and if it is in your candidate block or one already confirmed on the blockchain.
The blockchain is immutable, meaning it is not subject to change. You cannot make changes to a block that has already been confirmed and added to the chain, if there is any malicious activity going on, using consensus the malicious chain can be abandoned and everyone would continue with the genuine one.
- Jay -
██████████████████████
██
█████████████████████
██
██
█████
███████████
█████
██
██
███
████
███████
████
███
██
██
███
███
█████████
███
███
██
██
████
██
███
███
█████████
██
██
████████
█████
████████
██
██
█████████
███
███
██
████
██
██
███
███
█████████
███
███
██
██
███
████
███████
████
███
██
██
█████
███████████
█████
██
██
█████████████████████
██
██████████████████████
.
S
H
U
F
F
L
E
.COM
..
███████████████████████
███████████████████████
████
███████████
████████
███
██
████████████
██████
███
██
██
████████████
████
███
██
█
██
██████████
██
█
██
███
██
█
██
█
██
████
██
█
██
███
███
██
█
██
████
██
████
██
███
███
██
█
██
█
██
████
██
█
██
███
█████
█
██
██████████
██
███
███████
████████████
████
█████████
██████████████
████████████
███████████
███████████████████████
███████████████████████
███████
█████████
███████
█████
██
█████████
██
█
████
████
████
███████
████
█
███
███
██
██
██
█████
██
██
██
██
█
███
██
██
██
█████
██
██
██
███
███
██
██
██
█████
██
██
██
███
████
████
███████
████
████
█████
██
█████████
██
█████
███████
█████████
███████
█████████
██████████████
███████████
████████████
.
...
Ne
xt
Ge
ne
ra
ti
on
Crypto Casino
...
o_e_l_e_o
In memoriam
Legendary
Offline
Activity: 2268
Merit: 18510
Re: Can this fix a Problematic block in Bitcoin Core?
June 05, 2023, 09:45:27 AM
Merited
by
ABCbits
(2),
vapourminer
(1)
#3
You can freely edit the code of your own copy of Bitcoin Core to make it run locally in a specific way you choose, such as changing your mempool parameters, what criteria you will accept for replacing transactions, how many nodes you will connect to, what you will relay, and so forth. There is no problem making these kinds of changes and your node will continue to run and connect to peers just fine.
The issue will arise if you make a change which breaks with the consensus rules - for example, you start considering some blocks invalid, which the rest of the network still considers valid. At that point you will have forked yourself away from the main network and on to your own personal branch.
This is of course assuming you don't make a change which just breaks something entirely.
tromp
Legendary
Offline
Activity: 978
Merit: 1087
Re: Can this fix a Problematic block in Bitcoin Core?
June 05, 2023, 10:42:11 AM
Last edit: June 05, 2023, 11:47:36 AM by tromp
Merited
by
ABCbits
(1)
#4
Quote from: o_e_l_e_o on June 05, 2023, 09:45:27 AM
The issue will arise if you make a change which breaks with the consensus rules - for example, you start considering some blocks invalid, which the rest of the network still considers valid. At that point you will have forked yourself away from the main network and on to your own personal branch.
You won't have forked away until you produce at least one block with the differing consensus rule.
But unless you have a sizeable mining operation, it could take you years to even come up with a block satisfying the current difficulty...
The only exception is when your consensus changes include changing the PoW and/or difficulty rules.
o_e_l_e_o
In memoriam
Legendary
Offline
Activity: 2268
Merit: 18510
Re: Can this fix a Problematic block in Bitcoin Core?
June 05, 2023, 04:57:51 PM
#5
Quote from: tromp on June 05, 2023, 10:42:11 AM
You won't have forked away until you produce at least one block with the differing consensus rule.
Let's say I implement a change which considers all segwit transactions invalid. As such, my local chain rolls back to block 481,825, and I consider everything after that invalid. Even before I successfully mine a block at height 481,826, can we not say that I am working on a forked version of the main chain?
tromp
Legendary
Offline
Activity: 978
Merit: 1087
Re: Can this fix a Problematic block in Bitcoin Core?
June 05, 2023, 06:02:06 PM
Merited
by
o_e_l_e_o
(4)
#6
Quote from: o_e_l_e_o on June 05, 2023, 04:57:51 PM
Even before I successfully mine a block at height 481,826, can we not say that I am working on a forked version of the main chain?
Working on? Yes, we can say that. Even if you start coding the consensus changes, you're working on the fork.
Forked away? That is much less clear.
I would say not, since the "away" suggests each has gone its own way.
Davidvictorson
(OP)
Hero Member
Online
Activity: 980
Merit: 833
Livecasino.io
Re: Can this fix a Problematic block in Bitcoin Core?
June 06, 2023, 08:03:01 AM
#7
Quote from: o_e_l_e_o on June 05, 2023, 09:45:27 AM
You can freely edit the code of your own copy of Bitcoin Core to make it run locally in a specific way you choose, such as changing your mempool parameters, what criteria you will accept for replacing transactions, how many nodes you will connect to, what you will relay, and so forth. There is no problem making these kinds of changes and your node will continue to run and connect to peers just fine.
Hey o_e_l_e_o, this is just what I was looking for; that it is possible to fix a corrupt blk*.dat file and it can be done as long as I do not something crazy to the block that changes the consensus rule.
This is not my strong point though but I am still in the rabbit hole hopefully soon enough, I will get the hang of it. Thank you all.
██
██
██
██
██
██
██
██
██
██
██
██
██
...
⬤
⬤
LIVECASINO
.io
│
P
l
a
y
L
i
v
e
G
a
m
e
s
w
i
t
h
u
p
t
o
20%
c
a
s
h
b
a
c
k
!
...
██
██
██
██
██
██
██
██
██
██
██
██
██
nc50lc
Legendary
Offline
Activity: 2408
Merit: 5588
Self-proclaimed Genius
Re: Can this fix a Problematic block in Bitcoin Core?
June 06, 2023, 08:23:44 AM
Merited
by
o_e_l_e_o
(4),
ABCbits
(2)
#8
Quote from: Davidvictorson on June 06, 2023, 08:03:01 AM
-snip-
; that it is possible to fix a corrupt blk*.dat file and it can be done as long as I do not something crazy to the block that changes the consensus rule.
So it's just a simple "
fix
" to a corrupted block.dat file.
Bitcoin Core already has a feature that can detect corrupted blocks or other data and may start with an error.
Running command line option at start like
-reindex
(
depending on the error
) is the usual solution to this, no need to change a line code or anything.
What everyone explained is if you want to change in the protocol, because it is what OP sounds like.
.
.
HUGE
.
▄██
████████▄▄
▄██
███████████████▄
▄██
███████████████████▄
▄██
█████████████████████▄
▄██
███████████████████████▄
██
███
██▌
█
██▌▐██▐██▐████▄
███
██
██
▐██
█
▐██
█
██▌██▌██▌
█
██▌
██
██
███
▀███▀███▀▐██▐██
█
▐██
███
▀██
███████████████████████▀
▀██
█████████████████████▀
▀██
███████████████████▀
▀██
███████████████▀
▀██
████████▀▀
█▀▀▀▀
█
█
█
█
█
█
█
█
█
█
█
█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
C
A
SI
N
O
&
S
PO
R
T
S
B
O
O
K
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█
█
█
█
█
█
█
█
█
█
█
█
▄▄▄▄█
FAST PAYMENTS
....
NO KYC
....
o_e_l_e_o
In memoriam
Legendary
Offline
Activity: 2268
Merit: 18510
Re: Can this fix a Problematic block in Bitcoin Core?
June 06, 2023, 12:07:05 PM
Merited
by
ABCbits
(1)
#9
Quote from: Davidvictorson on June 06, 2023, 08:03:01 AM
Hey o_e_l_e_o, this is just what I was looking for; that it is possible to fix a corrupt blk*.dat file and it can be done as long as I do not something crazy to the block that changes the consensus rule.
So this is a completely different scenario to what you described in your first post. You cannot fix a corrupted block by editing your Bitcoin Core files, since the two things are entirely separate. You also shouldn't try to manually edit your blk*.dat files to fix a mistake, as you will almost certainly just create more errors in the process.
As nc50lc says, the correct approach to a corrupted blk*.dat file is to run Bitcoin Core with the
-reindex
option. This will wipe your block index and your chainstate and build them from your blk*.dat files. If it finds a corrupted block or blocks, it will request a replacement from peers.
Davidvictorson
(OP)
Hero Member
Online
Activity: 980
Merit: 833
Livecasino.io
Re: Can this fix a Problematic block in Bitcoin Core?
June 06, 2023, 02:09:26 PM
#10
Quote from: nc50lc on June 06, 2023, 08:23:44 AM
Quote from: Davidvictorson on June 06, 2023, 08:03:01 AM
-snip-
; that it is possible to fix a corrupt blk*.dat file and it can be done as long as I do not something crazy to the block that changes the consensus rule.
So it's just a simple "
fix
" to a corrupted block.dat file.
Bitcoin Core already has a feature that can detect corrupted blocks or other data and may start with an error.
Running command line option at start like
-reindex
(
depending on the error
) is the usual solution to this, no need to change a line code or anything.
What everyone explained is if you want to change in the protocol, because it is what OP sounds like.
Thank you nc50lc clarification and o_e_l_e_o for the elaboration. Obviously I still have a lot to learn here but this is a good start that would build on the already future learning on this subject matter.
██
██
██
██
██
██
██
██
██
██
██
██
██
...
⬤
⬤
LIVECASINO
.io
│
P
l
a
y
L
i
v
e
G
a
m
e
s
w
i
t
h
u
p
t
o
20%
c
a
s
h
b
a
c
k
!
...
██
██
██
██
██
██
██
██
██
██
██
██
██
Pages: [
1
]
Print
Bitcoin Forum
>
Bitcoin
>
Development & Technical Discussion
>
Can this fix a Problematic block in Bitcoin Core?
« previous topic
next topic »
Jump to:
Please select a destination:
-----------------------------
Bitcoin
-----------------------------
=> Bitcoin Discussion
===> Legal
===> Press
===> Meetups
===> Important Announcements
=> Development & Technical Discussion
===> Wallet software
=====> Electrum
=====> Bitcoin Wallet for Android
=====> BitcoinJ
=====> Armory
=====> Mycelium
=====> Hardware wallets
=> Mining
===> Mining support
===> Pools
===> Mining software (miners)
===> Hardware
=====> Group buys
===> Mining speculation
=> Bitcoin Technical Support
=> Project Development
-----------------------------
Economy
-----------------------------
=> Economics
===> Speculation
=> Marketplace
===> Goods
=====> Computer hardware
=====> Digital goods
=======> Invites & Accounts
=====> Collectibles
===> Services
===> Currency exchange
===> Gambling
=====> Games and rounds
=====> Investor-based games
=====> Gambling discussion
===> Lending
=====> Long-term offers
===> Securities
===> Auctions
===> Service Announcements
=====> Micro Earnings
===> Service Discussion
=====> Web Wallets
=====> Exchanges
=> Trading Discussion
===> Scam Accusations
===> Reputation
-----------------------------
Other
-----------------------------
=> Meta
===> New forum software
===> Bitcoin Wiki
=> Politics & Society
=> Beginners & Help
=> Off-topic
=> Serious discussion
===> Ivory Tower
=> Archival
===> Корзина
===> CPU/GPU Bitcoin mining hardware
===> Chinese students
===> Obsolete (buying)
===> Obsolete (selling)
===> MultiBit
-----------------------------
Alternate cryptocurrencies
-----------------------------
=> Altcoin Discussion
=> Announcements (Altcoins)
===> Tokens (Altcoins)
=> Mining (Altcoins)
===> Pools (Altcoins)
=> Marketplace (Altcoins)
===> Service Announcements (Altcoins)
===> Service Discussion (Altcoins)
===> Bounties (Altcoins)
=> Speculation (Altcoins)
-----------------------------
Local
-----------------------------
=> العربية (Arabic)
===> العملات البديلة (Altcoins)
=====> النقاشات
===> إستفسارات و أسئلة المبتدئين
===> التعدين
===> النقاشات الأخرى
===> منصات التبادل
=> Bahasa Indonesia (Indonesian)
===> Marketplace (Bahasa Indonesia)
===> Mining (Bahasa Indonesia)
===> Altcoins (Bahasa Indonesia)
===> Trading dan Spekulasi
===> Ekonomi, Politik, dan Budaya
===> Topik Lainnya
=> Español (Spanish)
===> Mercado y Economía
=====> Servicios
=====> Trading y especulación
===> Hardware y Minería
===> Esquina Libre
===> Mercadillo
=====> Mexico
=====> Argentina
=====> España
=====> Centroamerica y Caribe
===> Primeros pasos y ayuda
===> Altcoins (criptomonedas alternativas)
=====> Minería de altcoins
=====> Servicios
=====> Tokens (Español)
=> 中文 (Chinese)
===> 跳蚤市场
===> 山寨币
===> 媒体
===> 挖矿
===> 离题万里
=> Hrvatski (Croatian)
===> Trgovina
===> Altcoins (Hrvatski)
=====> Announcements (Hrvatski)
===> Off-topic (Hrvatski)
=> Deutsch (German)
===> Anfänger und Hilfe
===> Mining (Deutsch)
===> Trading und Spekulation
===> Projektentwicklung
===> Off-Topic (Deutsch)
===> Treffen
===> Presse
===> Altcoins (Deutsch)
=====> Announcements (Deutsch)
===> Marktplatz
=====> Auktionen
=====> Suche
=====> Biete
=> Ελληνικά (Greek)
===> Αγορά
===> Mining Discussion (Ελληνικά)
===> Altcoins (Ελληνικά)
=====> Altcoin Announcements (Ελληνικά)
=====> Altcoin Mining (Ελληνικά)
=> עברית (Hebrew)
=> Français
===> Actualité et News
===> Débutants
===> Discussions générales et utilisation du Bitcoin
===> Mining et Hardware
===> Économie et spéculation
===> Place de marché
=====> Échanges
=====> Produits et services
=====> Petites annonces
===> Le Bitcoin et la loi
===> Wiki, documentation et traduction
===> Développement et technique
===> Vos sites et projets
===> Hors-sujet
===> Altcoins (Français)
=====> Annonces
=> India
===> Mining (India)
===> Marketplace (India)
===> Regional Languages (India)
===> Press & News from India
===> Alt Coins (India)
===> Buyer/ Seller Reputations (India)
===> Off-Topic (India)
=> Italiano (Italian)
===> Guide (Italiano)
===> Progetti
===> Discussioni avanzate e sviluppo
===> Trading, analisi e speculazione
===> Mercato
=====> Mercato valute
=====> Beni
=====> Servizi
=====> Esercizi commerciali
=====> Hardware/Mining (Italiano)
=====> Gambling (Italiano)
===> Accuse scam/truffe
===> Mining (Italiano)
===> Alt-Currencies (Italiano)
=====> Annunci
===> Raduni/Meeting (Italiano)
===> Crittografia e decentralizzazione
===> Off-Topic (Italiano)
=> 日本語 (Japanese)
===> アルトコイン
=> Nederlands (Dutch)
===> Markt
===> Gokken/lotterijen
===> Mining (Nederlands)
===> Beurzen
===> Alt Coins (Nederlands)
===> Off-topic (Nederlands)
===> Meetings (Nederlands)
=> Nigeria (Naija)
===> Politics and society (Naija)
===> Off-topic (Naija)
=> 한국어 (Korean)
===> 대체코인 Alt Coins (한국어)
=> Pilipinas
===> Altcoins (Pilipinas)
=====> Altcoin Announcements (Pilipinas)
===> Pamilihan
===> Others (Pilipinas)
=> Polski
===> Tablica ogłoszeń
===> Alternatywne kryptowaluty
=====> Nowe kryptowaluty i tokeny
=====> Tablica ogłoszeń (altcoiny)
=> Português (Portuguese)
===> Primeiros Passos (Iniciantes)
===> Economia & Mercado
===> Mineração em Geral
===> Desenvolvimento & Discussões Técnicas
===> Criptomoedas Alternativas
===> Brasil
===> Portugal
=> Русский (Russian)
===> Новички
===> Бизнес
=====> Барахолка
=====> Обменники
===> Идеи
===> Кодеры
===> Майнеры
===> Политика
===> Трейдеры
===> Альтернативные криптовалюты
=====> Токены
=====> Бayнти и aиpдpoпы
===> Хайпы
===> Работа
===> Разное
===> Oбcyждeниe Bitcoin
=====> Новости
=====> Юристы
=> Română (Romanian)
===> Anunturi importante
===> Offtopic
===> Market
=====> Discutii Servicii
===> Minerit
===> Tutoriale
===> Bine ai venit!
===> Presa
===> Altcoins (Monede Alternative)
=====> Anunturi Monede Alternative
=> Skandinavisk
=> Türkçe (Turkish)
===> Bitcoin Haberleri
===> Pazar Alanı
===> Madencilik
===> Ekonomi
===> Servisler
=====> Fonlar
===> Proje Geliştirme
===> Alternatif Kripto-Paralar
=====> Madencilik (Alternatif Kripto-Paralar)
=====> Duyurular (Alternatif Kripto-Paralar)
===> Konu Dışı
===> Yeni Başlayanlar & Yardım
===> Buluşmalar
=> Other languages/locations
Loading...