Browse Source

should fix mapNewBlock variable that commented out last year.

miguelfreitas
Miguel Freitas 11 years ago
parent
commit
2aa2b7b3a3
  1. 10
      src/rpcmining.cpp

10
src/rpcmining.cpp

@ -116,7 +116,7 @@ Value getwork(const Array& params, bool fHelp)
if (IsInitialBlockDownload()) if (IsInitialBlockDownload())
throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, "Twister is downloading blocks..."); throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, "Twister is downloading blocks...");
typedef map<uint256, pair<CBlock*, CScript> > mapNewBlock_t; typedef map<uint256, pair<CBlock*, CTransaction> > mapNewBlock_t;
static mapNewBlock_t mapNewBlock; // FIXME: thread safety static mapNewBlock_t mapNewBlock; // FIXME: thread safety
static vector<CBlockTemplate*> vNewBlockTemplate; static vector<CBlockTemplate*> vNewBlockTemplate;
@ -167,9 +167,7 @@ Value getwork(const Array& params, bool fHelp)
IncrementExtraNonce(pblock, pindexPrev, nExtraNonce); IncrementExtraNonce(pblock, pindexPrev, nExtraNonce);
// Save // Save
/* [MF] Check! mapNewBlock[pblock->hashMerkleRoot] = make_pair(pblock, pblock->vtx[0]);
mapNewBlock[pblock->hashMerkleRoot] = make_pair(pblock, pblock->vtx[0].vin[0].scriptSig);
*/
// Pre-build hash buffers // Pre-build hash buffers
char pmidstate[32]; char pmidstate[32];
@ -205,9 +203,7 @@ Value getwork(const Array& params, bool fHelp)
pblock->nTime = pdata->nTime; pblock->nTime = pdata->nTime;
pblock->nNonce = pdata->nNonce; pblock->nNonce = pdata->nNonce;
/* [MF] pblock->vtx[0] = mapNewBlock[pdata->hashMerkleRoot].second;
pblock->vtx[0].vin[0].scriptSig = mapNewBlock[pdata->hashMerkleRoot].second;
*/
pblock->hashMerkleRoot = pblock->BuildMerkleTree(); pblock->hashMerkleRoot = pblock->BuildMerkleTree();
return CheckWork(pblock, *pwalletMain); return CheckWork(pblock, *pwalletMain);

Loading…
Cancel
Save