aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_bitcoin.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2016-10-18 21:11:22 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2016-10-18 21:16:08 +0200
commit744d2652dda0251bad7c1d8e3bbb468c2fe27510 (patch)
treee5ec5ff5dd0238954af403425b94a4e084369244 /src/test/test_bitcoin.cpp
parente10af96cf450494fdb893b71540e709ed311b871 (diff)
parent9fce0629b437441cb09c14055ee810b8ee6b7978 (diff)
Merge #8223: [c++11] Use std::unique_ptr for block creation.
9fce062 [c++11] Use std::unique_ptr for block creation. (Daniel Kraft)
Diffstat (limited to 'src/test/test_bitcoin.cpp')
-rw-r--r--src/test/test_bitcoin.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/test/test_bitcoin.cpp b/src/test/test_bitcoin.cpp
index 27ea837fbf..97076d1acb 100644
--- a/src/test/test_bitcoin.cpp
+++ b/src/test/test_bitcoin.cpp
@@ -22,6 +22,8 @@
#include "test/testutil.h"
+#include <memory>
+
#include <boost/filesystem.hpp>
#include <boost/test/unit_test.hpp>
#include <boost/thread.hpp>
@@ -111,7 +113,7 @@ CBlock
TestChain100Setup::CreateAndProcessBlock(const std::vector<CMutableTransaction>& txns, const CScript& scriptPubKey)
{
const CChainParams& chainparams = Params();
- CBlockTemplate *pblocktemplate = BlockAssembler(chainparams).CreateNewBlock(scriptPubKey);
+ std::unique_ptr<CBlockTemplate> pblocktemplate = BlockAssembler(chainparams).CreateNewBlock(scriptPubKey);
CBlock& block = pblocktemplate->block;
// Replace mempool-selected txns with just coinbase plus passed-in txns:
@@ -128,7 +130,6 @@ TestChain100Setup::CreateAndProcessBlock(const std::vector<CMutableTransaction>&
ProcessNewBlock(state, chainparams, NULL, &block, true, NULL, connman);
CBlock result = block;
- delete pblocktemplate;
return result;
}