aboutsummaryrefslogtreecommitdiff
path: root/src/rpc
diff options
context:
space:
mode:
Diffstat (limited to 'src/rpc')
-rw-r--r--src/rpc/blockchain.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp
index 92601a5ec..d06c00cbc 100644
--- a/src/rpc/blockchain.cpp
+++ b/src/rpc/blockchain.cpp
@@ -1071,7 +1071,20 @@ static UniValue SoftForkMajorityDesc(int version, CBlockIndex* pindex, const Con
activated = pindex->nHeight >= consensusParams.BIP66Height;
break;
case 4:
- activated = pindex->nHeight >= consensusParams.BIP65Height;
+ int nFound = 0;
+ int nRequired = consensusParams.nMajorityRejectBlockOutdated;
+ CBlockIndex* pstart = pindex;
+ for (int i = 0; i < consensusParams.nMajorityWindow && pstart != NULL; i++)
+ {
+ if (pstart->nVersion >= version)
+ ++nFound;
+ pstart = pstart->pprev;
+ }
+
+ activated = nFound >= nRequired;
+ rv.push_back(Pair("found", nFound));
+ rv.push_back(Pair("required", nRequired));
+ rv.push_back(Pair("window", consensusParams.nMajorityWindow));
break;
}
rv.push_back(Pair("status", activated));