Bitcoin Forum
June 27, 2017, 04:03:09 AM *
News: Latest stable version of Bitcoin Core: 0.14.2  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Is the maturation time for new coins documented anywhere else?  (Read 1648 times)
fivebells
Sr. Member
****
Offline Offline

Activity: 462


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?)
1498536189
Hero Member
*
Offline Offline

Posts: 1498536189

View Profile Personal Message (Offline)

Ignore
1498536189
Reply with quote  #2

1498536189
Report to moderator
1498536189
Hero Member
*
Offline Offline

Posts: 1498536189

View Profile Personal Message (Offline)

Ignore
1498536189
Reply with quote  #2

1498536189
Report to moderator
POLONIEX TRADING SIGNALS
+50% Profit and more via TELEGRAM
ALTCOINTRADER.CO
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1498536189
Hero Member
*
Offline Offline

Posts: 1498536189

View Profile Personal Message (Offline)

Ignore
1498536189
Reply with quote  #2

1498536189
Report to moderator
theymos
Administrator
Legendary
*
expert
Offline Offline

Activity: 2702


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
Sr. Member
****
Offline Offline

Activity: 462


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:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!