mirror of
				https://github.com/bitcoin/bips.git
				synced 2025-10-27 14:09:10 +00:00 
			
		
		
		
	Merge pull request #388 from stevenroose/patch-2
Error in BIP0009 code example
This commit is contained in:
		
						commit
						9a995e6879
					
				| @ -112,7 +112,7 @@ other one simultaneously transitions to STARTED, which would mean both would dem | |||||||
| 
 | 
 | ||||||
| Note that a block's state never depends on its own nVersion; only on that of its ancestors. | Note that a block's state never depends on its own nVersion; only on that of its ancestors. | ||||||
| 
 | 
 | ||||||
|         case STARTED: { |         case STARTED:  | ||||||
|             if (GetMedianTimePast(block.parent) >= timeout) { |             if (GetMedianTimePast(block.parent) >= timeout) { | ||||||
|                 return FAILED; |                 return FAILED; | ||||||
|             } |             } | ||||||
| @ -120,14 +120,14 @@ Note that a block's state never depends on its own nVersion; only on that of its | |||||||
|             walk = block; |             walk = block; | ||||||
|             for (i = 0; i < 2016; i++) { |             for (i = 0; i < 2016; i++) { | ||||||
|                 walk = walk.parent; |                 walk = walk.parent; | ||||||
|                 if (walk.nVersion & 0xE0000000 == 0x2000000 && (walk.nVersion >> bit) & 1 == 1) { |                 if (walk.nVersion & 0xE0000000 == 0x20000000 && (walk.nVersion >> bit) & 1 == 1) { | ||||||
|                     count++; |                     count++; | ||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
|             if (count >= threshold) { |             if (count >= threshold) { | ||||||
|                 return LOCKED_IN; |                 return LOCKED_IN; | ||||||
|             } |             } | ||||||
|         } |             return STARTED; | ||||||
| 
 | 
 | ||||||
| After a retarget period of LOCKED_IN, we automatically transition to ACTIVE. | After a retarget period of LOCKED_IN, we automatically transition to ACTIVE. | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user