Add nHeight

This commit is contained in:
jl777
2018-05-30 02:56:05 -11:00
parent d9f176ac7e
commit cf1b8419d4

View File

@@ -214,7 +214,7 @@ UniValue generate(const UniValue& params, bool fHelp)
lastTime = GetTime(); lastTime = GetTime();
#ifdef ENABLE_WALLET #ifdef ENABLE_WALLET
std::unique_ptr<CBlockTemplate> pblocktemplate(CreateNewBlockWithKey(reservekey)); std::unique_ptr<CBlockTemplate> pblocktemplate(CreateNewBlockWithKey(reservekey,nHeight));
#else #else
std::unique_ptr<CBlockTemplate> pblocktemplate(CreateNewBlockWithKey()); std::unique_ptr<CBlockTemplate> pblocktemplate(CreateNewBlockWithKey());
#endif #endif
@@ -639,7 +639,7 @@ UniValue getblocktemplate(const UniValue& params, bool fHelp)
} }
#ifdef ENABLE_WALLET #ifdef ENABLE_WALLET
CReserveKey reservekey(pwalletMain); CReserveKey reservekey(pwalletMain);
pblocktemplate = CreateNewBlockWithKey(reservekey); pblocktemplate = CreateNewBlockWithKey(reservekey,chainActive.Tip()->nHeight+1);
#else #else
pblocktemplate = CreateNewBlockWithKey(); pblocktemplate = CreateNewBlockWithKey();
#endif #endif