diff options
| author | Wladimir J. van der Laan <[email protected]> | 2016-11-21 10:51:32 +0100 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2016-11-21 10:51:37 +0100 |
| commit | 7490ae8b699d2955b665cf849d86ff5bb5245c28 (patch) | |
| tree | 31f4d8edd5134e92bf133ee3dfd52651c14ed21e /src/rpc/mining.cpp | |
| parent | Merge #9159: [qa] Wait for specific block announcement in p2p-compactblocks (diff) | |
| parent | Introduce convenience type CTransactionRef (diff) | |
| download | discoin-7490ae8b699d2955b665cf849d86ff5bb5245c28.tar.xz discoin-7490ae8b699d2955b665cf849d86ff5bb5245c28.zip | |
Merge #9125: Make CBlock a vector of shared_ptr of CTransactions
b4e4ba4 Introduce convenience type CTransactionRef (Pieter Wuille)
1662b43 Make CBlock::vtx a vector of shared_ptr<CTransaction> (Pieter Wuille)
da60506 Add deserializing constructors to CTransaction and CMutableTransaction (Pieter Wuille)
0e85204 Add serialization for unique_ptr and shared_ptr (Pieter Wuille)
Diffstat (limited to 'src/rpc/mining.cpp')
| -rw-r--r-- | src/rpc/mining.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp index ad545bdf0..6b0e52a30 100644 --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -557,7 +557,8 @@ UniValue getblocktemplate(const JSONRPCRequest& request) UniValue transactions(UniValue::VARR); map<uint256, int64_t> setTxIndex; int i = 0; - BOOST_FOREACH (CTransaction& tx, pblock->vtx) { + for (const auto& it : pblock->vtx) { + const CTransaction& tx = *it; uint256 txHash = tx.GetHash(); setTxIndex[txHash] = i++; @@ -662,7 +663,7 @@ UniValue getblocktemplate(const JSONRPCRequest& request) result.push_back(Pair("previousblockhash", pblock->hashPrevBlock.GetHex())); result.push_back(Pair("transactions", transactions)); result.push_back(Pair("coinbaseaux", aux)); - result.push_back(Pair("coinbasevalue", (int64_t)pblock->vtx[0].vout[0].nValue)); + result.push_back(Pair("coinbasevalue", (int64_t)pblock->vtx[0]->vout[0].nValue)); result.push_back(Pair("longpollid", chainActive.Tip()->GetBlockHash().GetHex() + i64tostr(nTransactionsUpdatedLast))); result.push_back(Pair("target", hashTarget.GetHex())); result.push_back(Pair("mintime", (int64_t)pindexPrev->GetMedianTimePast()+1)); |