[c++11] Use std::unique_ptr for block creation.

CreateNewBlock returns a pointer for which the caller takes ownership.
Use std::unique_ptr to make this explicit and simplify handling of these
objects in getblocktemplate.
This commit is contained in:
Daniel Kraft
2016-06-18 19:38:28 +02:00
parent ed2cd59e25
commit 9fce0629b4
5 changed files with 15 additions and 24 deletions

View File

@@ -160,7 +160,7 @@ private:
public:
BlockAssembler(const CChainParams& chainparams);
/** Construct a new block template with coinbase to scriptPubKeyIn */
CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn);
std::unique_ptr<CBlockTemplate> CreateNewBlock(const CScript& scriptPubKeyIn);
private:
// utility functions