aboutsummaryrefslogtreecommitdiff
path: root/src/rpcmining.cpp
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2015-03-31 20:35:04 -0700
committerPieter Wuille <pieter.wuille@gmail.com>2015-04-01 11:47:10 -0700
commite2edf95cd3f43331843676e49a82830128a95050 (patch)
tree45a1f675182b1570704d14b1a7d8125fb5b3b8b5 /src/rpcmining.cpp
parent6b04508e37c5dd18cec1cd61cc4356bd208aa991 (diff)
downloadbitcoin-e2edf95cd3f43331843676e49a82830128a95050.tar.xz
Bugfix: make CreateNewBlock return pindexPrev
Diffstat (limited to 'src/rpcmining.cpp')
-rw-r--r--src/rpcmining.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rpcmining.cpp b/src/rpcmining.cpp
index 49c5c3ca58..6f165028d5 100644
--- a/src/rpcmining.cpp
+++ b/src/rpcmining.cpp
@@ -475,7 +475,7 @@ Value getblocktemplate(const Array& params, bool fHelp)
// Store the pindexBest used before CreateNewBlock, to avoid races
nTransactionsUpdatedLast = mempool.GetTransactionsUpdated();
- CBlockIndex* pindexPrevNew = chainActive.Tip();
+ CBlockIndex* pindexPrevNew;
nStart = GetTime();
// Create new block
@@ -485,7 +485,7 @@ Value getblocktemplate(const Array& params, bool fHelp)
pblocktemplate = NULL;
}
CScript scriptDummy = CScript() << OP_TRUE;
- pblocktemplate = CreateNewBlock(scriptDummy);
+ pblocktemplate = CreateNewBlock(scriptDummy, pindexPrevNew);
if (!pblocktemplate)
throw JSONRPCError(RPC_OUT_OF_MEMORY, "Out of memory");