Bitcoin Forum
May 24, 2024, 01:45:08 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Help to understand the Bitcoin C++ Code  (Read 806 times)
gotoalberto (OP)
Newbie
*
Offline Offline

Activity: 37
Merit: 0



View Profile WWW
November 29, 2013, 12:10:57 PM
 #1

Anyone can explain me the purpose of this variable?

https://github.com/bitcoin/bitcoin/blob/master/src/main.cpp#L993

Thanks a lot in advance!
Remember remember the 5th of November
Legendary
*
Offline Offline

Activity: 1862
Merit: 1011

Reverse engineer from time to time


View Profile
November 29, 2013, 12:14:22 PM
 #2

Anyone can explain me the purpose of this variable?

https://github.com/bitcoin/bitcoin/blob/master/src/main.cpp#L993

Thanks a lot in advance!
I am not versed in the Bitcoin source code, but the network tries to keep Block generation at 2016 blocks per two weeks(6 per hour), due to variance this isn't possible to control entirely, but it tries. If 2016 blocks took less than two weeks, the difficulty goes up, likewise if it took longer than 2 weeks, it goes down. So the variable is used to determine that somewhere I guess.

BTC:1AiCRMxgf1ptVQwx6hDuKMu4f7F27QmJC2
wumpus
Hero Member
*****
qt
Offline Offline

Activity: 812
Merit: 1022

No Maps for These Territories


View Profile
November 29, 2013, 12:15:25 PM
 #3

Yes, it is the targeted time between difficulty changes.

Bitcoin Core developer [PGP] Warning: For most, coin loss is a larger risk than coin theft. A disk can die any time. Regularly back up your wallet through FileBackup Wallet to an external storage or the (encrypted!) cloud. Use a separate offline wallet for storing larger amounts.
Sukrim
Legendary
*
Offline Offline

Activity: 2618
Merit: 1006


View Profile
November 29, 2013, 12:46:31 PM
 #4

14 days * 24 hours/day * 60 minutes/hour * 60 seconds/minute = amount of seconds in 14 days.

The use is already explained.

https://www.coinlend.org <-- automated lending at various exchanges.
https://www.bitfinex.com <-- Trade BTC for other currencies and vice versa.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!