Bitcoin Forum
September 18, 2025, 04:11:05 PM *
News: Latest Bitcoin Core release: 29.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Help to understand the Bitcoin C++ Code  (Read 838 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: 1018

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
laanwj
Hero Member
*****
qt
Offline Offline

Activity: 826
Merit: 1030


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

Yes, it is the targeted time between difficulty changes.
Sukrim
Legendary
*
Offline Offline

Activity: 2618
Merit: 1011


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!