# Bitcoin block isikhathi0122

Uyazi: Isikhathi esilindelekile phakathi kwamabhulokhi amabili e-Bitcoin siphakathi kwamaminithi $$10$$ amaminithi. Manje wenza ukuthengiselana okubalulekile kwe-Bitcoin futhi ulinde ngokulangazela ukubona ukuthi ivela nini futhi nini kubhlokhi elandelayo:

e50bfacc95975a4e7545d83d8954645f

Njengoba ungazange uhlole ukuthi ibhulokhi yangaphambilini yaqedwa nini, empeleni ulindele isilinganiso $$\frac{t}{2} = \frac{10}{2} = 5$$ imizuzu yesikhathi sokulinda. Ngemuva kokuthi $$5$$ imizuzu emide isiphelile, hlola ukuthi ibhulokhi yokugcina iqedwe nini ngempela:

e50bfacc95975a4e7545d83d8954645f

Ibhulokhi yokugcina bese iqediwe kakade emaminithini angu- $$7$$ edlule. Manje njengoba usulwazi lolu lwazi, isikhathi esilindelekile siyashintsha ukusuka kumaminithi angu- $$5$$ ukuya kunani eliphelele $$10$$ lamaminithi. Lokho kusho ukuthi: Emaminithini angu- $$3$$ cishe kuzoba manje. Ukhipha umyalo ngokuphindaphindiwe. Futhi ulinde. Ngemva kweminye $$10$$ imizuzu uthola umuzwa wokuthi kukhona okungalungile.

Kodwa-ke uyakhumbula lokho Indida yokulinda:

Uma amabhasi egijima njalo $$t$$ imizuzu ngokwesilinganiso, isikhathi sokulinda sesikhathi sokufika esingahleliwe esitobhini sebhasi asihambisani $$\frac{t}{2}$$ amaminithi, kodwa esimweni sokusatshalaliswa okukhulu. amabanga $$t$$ .

Izehlakalo ze-Bitcoin block ziyinqubo ye-Poisson ngakho-ke zisakazwa ngokucacile. Njengoba izinqubo ze-Poisson zingenankumbulo, ibhulokhi elandelayo nayo iqedwa ngemizuzu $$10$$ ngokwesilinganiso. Lokho kusebenza njalo - noma ngabe sesilinde isikhathi eside kangakanani. Izinga lokungakhumbuli lisebenza emuva naphambili ngesikhathi.

Kungenzeka kanjani lokho?

Ukuze senze lokhu, sicabangela izitatimende ezimbili ezilandelayo:

• A) Isikhathi sangempela sokulinda esimaphakathi phakathi kwamabhulokhi amabili $$10$$ imizuzu, hhayi $$20$$ imizuzu.
• B) Uma kukhethwa iphuzu lesikhathi esingahleliwe, silindele ukuthi ibhulokhi elidlule $$10$$ lamaminithi esikhathini esidlule kanye nebhulokhi elandelayo $$10$$ imizuzu esikhathini esizayo. Ngakho-ke singalindela isikhathi sokulinda $$20$$ imizuzu phakathi kwamabhulokhi.

Sihlola zombili izitatimende.

Ukuze senze lokhu, siqala ngokukhipha idatha efanele, ikakhulukazi izikhathi lapho amabhulokhi aqedwa khona, efayeleni le-TXT ( elizokwenziwa nge-node egcwele endaweni esekelwe ku- bitcoind ):

e50bfacc95975a4e7545d83d8954645f

Lokhu kusinika ifayela lombhalo elilandelayo , manje esesilicubungula ngokuqhubekayo futhi siligcina ku-/ time.txt . Okulandelayo Rust hlelo ukusetshenziselwa lokhu ifayela /Cargo.toml:

e50bfacc95975a4e7545d83d8954645f

Ifayela /src/main.rs liqukethe ingqondo yokuhlola yangempela:

e50bfacc95975a4e7545d83d8954645f

Sifaka ukuncika, sakhe uhlelo futhi siluqale:

e50bfacc95975a4e7545d83d8954645f

Ngempela, zombili izitatimende ziyiqiniso lapho sihlaziya okukhiphayo:

e50bfacc95975a4e7545d83d8954645f

Lokhu kungabuye kuchazwe ngendlela enembile ngale ndlela elandelayo: Uma izikhathi zebhulokhi zihluka kakhulu, isikhathi esithile sokulinda siyahluka - uma senza okwenziwayo endaweni engahleliwe ngesikhathi, amathuba aphezulu okuthi sizogcina sisesikhathini lapho isikhathi sokulinda side kunemizuzu eyi-10 kungenxa yokuthi lezi zikhawu nazo zithatha isikhala esiningi emugqeni wesikhathi ngenxa yesikhathi eside.

Emuva