"Returns an object containing various state info.");
Object obj;
- obj.push_back(Pair("version", (int)VERSION));
+ obj.push_back(Pair("version", FormatFullVersion()));
obj.push_back(Pair("balance", ValueFromAmount(pwalletMain->GetBalance())));
obj.push_back(Pair("newmint", ValueFromAmount(pwalletMain->GetNewMint())));
obj.push_back(Pair("stake", ValueFromAmount(pwalletMain->GetStake())));
nStart = GetTime();
// Create new block
- pblock = CreateNewBlock(pwalletMain);
+ pblock = CreateNewBlock(pwalletMain, true);
if (!pblock)
throw JSONRPCError(-7, "Out of memory");
vNewBlock.push_back(pblock);
}
// Update nTime
- pblock->nTime = max(pindexPrev->GetMedianTimePast()+1, GetAdjustedTime());
+ pblock->nTime = max(pblock->GetBlockTime(), GetAdjustedTime());
pblock->nNonce = 0;
// Update nExtraNonce
pblock->nNonce = pdata->nNonce;
pblock->vtx[0].vin[0].scriptSig = mapNewBlock[pdata->hashMerkleRoot].second;
pblock->hashMerkleRoot = pblock->BuildMerkleTree();
+ if (!pblock->SignBlock(*pwalletMain))
+ throw JSONRPCError(-100, "Unable to sign block");
return CheckWork(pblock, *pwalletMain, reservekey);
}
strPrefix = params[0].get_str();
CKey key;
+ int nCount = 0;
do
{
key.MakeNewKey();
- } while (strPrefix != HexStr(key.GetPubKey()).substr(0, strPrefix.size()));
+ nCount++;
+ } while (nCount < 10000 && strPrefix != HexStr(key.GetPubKey()).substr(0, strPrefix.size()));
+
+ if (strPrefix != HexStr(key.GetPubKey()).substr(0, strPrefix.size()))
+ return Value::null;
CPrivKey vchPrivKey = key.GetPrivKey();
Object result;