summaryrefslogtreecommitdiff
path: root/bip-0009.mediawiki
diff options
context:
space:
mode:
authorLuke-Jr <luke_github1@dashjr.org>2016-05-18 22:47:14 +0000
committerLuke-Jr <luke_github1@dashjr.org>2016-05-18 22:47:14 +0000
commit9a995e6879fdb5f06e9ac6102014109efe54d4de (patch)
tree86ab3dfce4efa67ff4b05d3ec5a5386010b36867 /bip-0009.mediawiki
parentf65541bf262cde0437add6e754f115ad0ec01a9c (diff)
parent580db159079a7a8f0ee3d6646e7e6a668fce00a2 (diff)
downloadbips-9a995e6879fdb5f06e9ac6102014109efe54d4de.tar.xz
Merge pull request #388 from stevenroose/patch-2
Error in BIP0009 code example
Diffstat (limited to 'bip-0009.mediawiki')
-rw-r--r--bip-0009.mediawiki6
1 files changed, 3 insertions, 3 deletions
diff --git a/bip-0009.mediawiki b/bip-0009.mediawiki
index 509a8a9..995ae85 100644
--- a/bip-0009.mediawiki
+++ b/bip-0009.mediawiki
@@ -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.
- case STARTED: {
+ case STARTED:
if (GetMedianTimePast(block.parent) >= timeout) {
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;
for (i = 0; i < 2016; i++) {
walk = walk.parent;
- if (walk.nVersion & 0xE0000000 == 0x2000000 && (walk.nVersion >> bit) & 1 == 1) {
+ if (walk.nVersion & 0xE0000000 == 0x20000000 && (walk.nVersion >> bit) & 1 == 1) {
count++;
}
}
if (count >= threshold) {
return LOCKED_IN;
}
- }
+ return STARTED;
After a retarget period of LOCKED_IN, we automatically transition to ACTIVE.