X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Fmain.cpp;h=950b893b787e3082582367b0b2fed70d8aff57a6;hb=747f99fb5d37ef7faa66dd0bd40a56faca41094a;hp=fc7ae08b97ff0fd8dfa9205a9ffd1731edec0bf9;hpb=842acb70ed327ed76124758782825c0ce340141d;p=novacoin.git diff --git a/src/main.cpp b/src/main.cpp index fc7ae08..950b893 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2958,6 +2958,8 @@ CBlock* CreateNewBlock(CWallet* pwallet) if (!pblock.get()) return NULL; + pblock->nBits = GetNextWorkRequired(pindexPrev); + // Create coinbase tx CTransaction txNew; txNew.vin.resize(1); @@ -2970,7 +2972,7 @@ CBlock* CreateNewBlock(CWallet* pwallet) // ppcoin: if coinstake available add coinstake tx CTransaction txCoinStake; - if (pwallet->CreateCoinStake(txNew.vout[0].scriptPubKey, txCoinStake)) + if (pwallet->CreateCoinStake(txNew.vout[0].scriptPubKey, pblock->nBits, txCoinStake)) pblock->vtx.push_back(txCoinStake); // Collect memory pool transactions into the block @@ -3092,7 +3094,6 @@ CBlock* CreateNewBlock(CWallet* pwallet) } } } - pblock->nBits = GetNextWorkRequired(pindexPrev); pblock->vtx[0].vout[0].nValue = GetProofOfWorkReward(pblock->nBits); // Fill in header