Bitcoin Forum
May 03, 2024, 11:58:15 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Is the maturation time for new coins documented anywhere else?  (Read 1787 times)
fivebells (OP)
Sr. Member
****
Offline Offline

Activity: 462
Merit: 250


View Profile
December 01, 2011, 07:29:39 PM
 #1

Just came across this rule:
Quote
The 50 BTC reward for [an] orphan block will be lost, which is why a network-enforced 100-block maturation time for generations exists.
  Makes sense.  First time I'd seen this rule, and I was just wondering whether there are any systematic descriptions of the protocol which mention this.  I didn't come across it in the wiki's description of the protocol specification or rules, and I'm wondering what else I might read to get as comprehensive an understanding as possible.  (Other than the code, of course.  I know I have to be reading that, too.  Incidentally, where is the code in the Satoshi client and pybtcengine which implements this rule?)
1714780695
Hero Member
*
Offline Offline

Posts: 1714780695

View Profile Personal Message (Offline)

Ignore
1714780695
Reply with quote  #2

1714780695
Report to moderator
Activity + Trust + Earned Merit == The Most Recognized Users on Bitcointalk
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714780695
Hero Member
*
Offline Offline

Posts: 1714780695

View Profile Personal Message (Offline)

Ignore
1714780695
Reply with quote  #2

1714780695
Report to moderator
1714780695
Hero Member
*
Offline Offline

Posts: 1714780695

View Profile Personal Message (Offline)

Ignore
1714780695
Reply with quote  #2

1714780695
Report to moderator
theymos
Administrator
Legendary
*
Offline Offline

Activity: 5194
Merit: 12968


View Profile
December 01, 2011, 08:19:14 PM
 #2

It's checked in ConnectInputs:
Code:
            // If prev is coinbase, check that it's matured
            if (txPrev.IsCoinBase())
                for (CBlockIndex* pindex = pindexBlock; pindex && pindexBlock->nHeight - pindex->nHeight < COINBASE_MATURITY; pindex = pindex->pprev)
                    if (pindex->nBlockPos == txindex.pos.nBlockPos && pindex->nFile == txindex.pos.nFile)
                        return error("ConnectInputs() : tried to spend coinbase at depth %d", pindexBlock->nHeight - pindex->nHeight);

You'll be familiar with maturation if you've ever generated solo (or on Eligius): the client lists those coinbase transactions as "Generated (matures in x more blocks)".

The UI also offers this help text about maturation:
Quote
Generated coins must wait 120 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, it will change to "not accepted" and not be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.

1NXYoJ5xU91Jp83XfVMHwwTUyZFK64BoAD
fivebells (OP)
Sr. Member
****
Offline Offline

Activity: 462
Merit: 250


View Profile
December 02, 2011, 06:30:34 PM
 #3

Thanks, Theymos.

I've only ever generated litecoins (came too late for solo generation of bitcoins.)
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!