# Ixesha block Bitcoin0122

Uyazi: Ixesha elilindelekileyo phakathi kweebhloko ezimbini zeBitcoin kumndilili $$10$$ imizuzu. Ngoku wenza intengiselwano ebalulekileyo yeBitcoin kwaye ulinde ngolangazelelo ukubona ukuba kwaye xa ivela kwibhloko elandelayo:

e50bfacc95975a4e7545d83d8954645f

Ekubeni awukhange ukhangele xa ibhloko yangaphambili igqityiwe, ngokwenene ulindele umyinge we- $$\frac{t}{2} = \frac{10}{2} = 5$$ imizuzu yexesha lokulinda. Emva kokuba $$5$$ imizuzu emide idlulile, khangela ukuba ibhloko yokugqibela igqitywe nini na:

e50bfacc95975a4e7545d83d8954645f

Ibhloko yokugqibela yayisele igqityiwe $$7$$ kwimizuzu edlulileyo. Ngoku usazi olu lwazi, ixesha elilindelekileyo liyatshintsha ukusuka $$5$$ imizuzu ukuya kwinani elipheleleyo $$10$$ imizuzu. Oko kuthetha ukuba: malunga nemizuzu $$3$$ iya kuba ngoku. Ukhupha umyalelo ngokuphindaphindiweyo. Kwaye ulinde. Emva kwenye $$10$$ imizuzu ufumana imvakalelo yokuba kukho into engalunganga.

Kodwa ke ukhumbule oko I-paradox yokulinda:

Ukuba iibhasi ziqhuba yonke $$t$$ imizuzu ngokomndilili, ixesha lokulinda lexesha lokufika ngokungakhethiyo kwisikhululo sebhasi $$\frac{t}{2}$$ nemizuzu $$\frac{t}{2}$$ , kodwa kwimeko yokusasazwa ngokukhawuleza. imigama $$t$$ .

Izehlo zebhlokhi zeBitcoin yinkqubo yePoisson kwaye ke ngoko zisasazwa ngokukhawuleza. Ekubeni iinkqubo zePoisson zingenankumbulo, ibhloko elandelayo nayo igqitywe ngemizuzu eyi- $$10$$ ngokomndilili. Oko kuhlala kusebenza - nokuba kudala silindile. Umgangatho wokungabi nankumbulo usebenza ngasemva nangaphambili ngexesha.

Inokwenzeka njani loo nto?

Ukwenza oku, makhe siqwalasele ezi ngxelo zimbini zilandelayo:

• A) Elona xesha lokulinda eliphakathi phakathi kweebhloko ezimbini ngu $$10$$ imizuzu, hayi $$20$$ imizuzu.
• B) Ukuba kukhethwe indawo engacwangciswanga ngexesha, silindele ukuba ibhloko yangaphambili $$10$$ imizuzu kwixesha elidlulileyo kunye nebhloko elandelayo $$10$$ kwimizuzu kwixesha elizayo. Ngoko sinokulindela ixesha lokulinda lemizuzu $$20$$ phakathi kweebhloko.

Sijonga zombini iingxelo.

Ukwenza oku, siqale sikhuphe idatha echaphazelekayo, ngokukodwa amaxesha apho iibhloko zagqitywa khona, kwifayile ye-TXT (iya kuqhutywa nge-node epheleleyo yendawo esekelwe kwi- bitcoind ):

e50bfacc95975a4e7545d83d8954645f

Oku kusinika le fayile yokubhaliweyo ilandelayo , esiyiqhubekekisa ngoku phambili kwaye siyigcine kwi /time.txt . Le nkqubo ilandelayo yomhlwa isetyenziselwa oku ngefayile ye /Cargo.toml:

e50bfacc95975a4e7545d83d8954645f

Ifayile /src/main.rs iqulethe eyona logic yovavanyo:

e50bfacc95975a4e7545d83d8954645f

Sifaka ukuxhomekeka, ukwakha inkqubo kwaye siqale:

e50bfacc95975a4e7545d83d8954645f

Enyanisweni, zombini ezi nkcazo ziyinyani xa sihlalutya umphumo:

e50bfacc95975a4e7545d83d8954645f

Oku kunokuchazwa ngolu hlobo lulandelayo: Ukuba amaxesha ebhloko ahluka kakhulu, ixesha lokulinda elithile liyahluka - ukuba siqhuba intengiselwano kwindawo ethile ngexesha, amathuba aphezulu ukuba siya kuphelela kwixesha apho ixesha lokulinda lide kunemizuzu eli-10 kungenxa yokuba la mathuba nawo athatha indawo enkulu kumgca wexesha ngenxa yexesha elide.

Emva