]> Git Repo - VerusCoin.git/commitdiff
Add founders reward to output.
authorSimon <[email protected]>
Thu, 14 Jul 2016 20:05:32 +0000 (13:05 -0700)
committerSimon <[email protected]>
Thu, 14 Jul 2016 20:08:34 +0000 (13:08 -0700)
src/rpcmining.cpp

index f41f261957249bb5e91ecc05aefc2472d132d0d7..82bbe0c1243d5a257a0ac0ecb1c9ca18fee930b1 100644 (file)
@@ -772,11 +772,14 @@ Value getblocksubsidy(const Array& params, bool fHelp)
     if (fHelp || params.size() != 1)
         throw runtime_error(
             "getblocksubsidy height\n"
-            "\nReturns block subsidy reward, taking into account the mining slow start, of block at index provided.\n"
+            "\nReturns block subsidy reward, taking into account the mining slow start and the founders reward, of block at index provided.\n"
             "\nArguments:\n"
             "1. height        (numeric, required) The block height.\n"
             "\nResult:\n"
-            "amount           (numeric) The block reward amount in ZEC.\n"
+            "{\n"
+            "  \"miner\" : x.xxx           (numeric) The mining reward amount in ZEC.\n"
+            "  \"founders\" : x.xxx        (numeric) The founders reward amount in ZEC.\n"
+            "}\n"
             "\nExamples:\n"
             + HelpExampleCli("getblocksubsidy", "1000")
             + HelpExampleRpc("getblockubsidy", "1000")
@@ -788,5 +791,13 @@ Value getblocksubsidy(const Array& params, bool fHelp)
         throw JSONRPCError(RPC_INVALID_PARAMETER, "Block height out of range");
 
     CAmount nReward = GetBlockSubsidy(nHeight, Params().GetConsensus());
-    return ValueFromAmount(nReward);
+    CAmount nFoundersReward = 0;
+    if ((nHeight > 0) && (nHeight < Params().GetConsensus().nSubsidyHalvingInterval)) {
+        nFoundersReward = nReward/5;
+        nReward -= nFoundersReward;
+    }
+    Object result;
+    result.push_back(Pair("miner", ValueFromAmount(nReward)));
+    result.push_back(Pair("founders", ValueFromAmount(nFoundersReward)));
+    return result;
 }
This page took 0.025291 seconds and 4 git commands to generate.