Bitcoin Forum
May 10, 2024, 11:51:27 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How do clients enforce the 50 BTC generation rule?  (Read 8181 times)
bytemaster (OP)
Hero Member
*****
Offline Offline

Activity: 770
Merit: 566

fractally


View Profile WWW
August 03, 2010, 03:59:25 AM
 #1

Suppose one client decided to modify CBlock::GetBlockValue() which hardcodes 50 * COIN as nSubsidy to 1000 * COIN and they "complete a block", what would happen?  What line of code would catch this mis-match?

Shouldn't these kind of settings be in some kind of "config file" instead of distributed all over the code?   


https://fractally.com - the next generation of decentralized autonomous organizations (DAOs).
1715341887
Hero Member
*
Offline Offline

Posts: 1715341887

View Profile Personal Message (Offline)

Ignore
1715341887
Reply with quote  #2

1715341887
Report to moderator
1715341887
Hero Member
*
Offline Offline

Posts: 1715341887

View Profile Personal Message (Offline)

Ignore
1715341887
Reply with quote  #2

1715341887
Report to moderator
1715341887
Hero Member
*
Offline Offline

Posts: 1715341887

View Profile Personal Message (Offline)

Ignore
1715341887
Reply with quote  #2

1715341887
Report to moderator
Once a transaction has 6 confirmations, it is extremely unlikely that an attacker without at least 50% of the network's computation power would be able to reverse it.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715341887
Hero Member
*
Offline Offline

Posts: 1715341887

View Profile Personal Message (Offline)

Ignore
1715341887
Reply with quote  #2

1715341887
Report to moderator
1715341887
Hero Member
*
Offline Offline

Posts: 1715341887

View Profile Personal Message (Offline)

Ignore
1715341887
Reply with quote  #2

1715341887
Report to moderator
1715341887
Hero Member
*
Offline Offline

Posts: 1715341887

View Profile Personal Message (Offline)

Ignore
1715341887
Reply with quote  #2

1715341887
Report to moderator
knightmb
Sr. Member
****
Offline Offline

Activity: 308
Merit: 258



View Profile WWW
August 03, 2010, 04:13:54 AM
 #2

Suppose one client decided to modify CBlock::GetBlockValue() which hardcodes 50 * COIN as nSubsidy to 1000 * COIN and they "complete a block", what would happen?  What line of code would catch this mis-match?

Shouldn't these kind of settings be in some kind of "config file" instead of distributed all over the code?   


When I tested that, the other clients would ignore the one that decided to generate 1000 BTC a block for example.

Timekoin - The World's Most Energy Efficient Encrypted Digital Currency
theymos
Administrator
Legendary
*
Offline Offline

Activity: 5194
Merit: 12982


View Profile
August 03, 2010, 04:15:03 AM
Merited by bones261 (1)
 #3

The block won't be accepted by legitimate users. See ConnectBlock in main.cpp:
Code:
    if (vtx[0].GetValueOut() > GetBlockValue(nFees))
        return false;
(Line 1089)

1NXYoJ5xU91Jp83XfVMHwwTUyZFK64BoAD
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!