aboutsummaryrefslogtreecommitdiff
path: root/src/rpc
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2017-01-04 12:22:49 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2017-01-04 12:23:10 +0100
commit869781c51cc1b6ee0a8635bcefbcbe11db7f5b25 (patch)
tree9f566f00ccb67f888c6e5a8026215fed51169514 /src/rpc
parentd9ae1cefa081c7ef978fab0b288475692678af72 (diff)
parent91335ba389918966c94eeb7071b6c5a998bf1be8 (diff)
downloadbitcoin-869781c51cc1b6ee0a8635bcefbcbe11db7f5b25.tar.xz
Merge #9283: A few more CTransactionRef optimizations
91335ba Remove unused MakeTransactionRef overloads (Pieter Wuille) 6713f0f Make FillBlock consume txn_available to avoid shared_ptr copies (Pieter Wuille) 62607d7 Convert COrphanTx to keep a CTransactionRef (Pieter Wuille) c44e4c4 Make AcceptToMemoryPool take CTransactionRef (Pieter Wuille)
Diffstat (limited to 'src/rpc')
-rw-r--r--src/rpc/rawtransaction.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp
index b99e5986ff..276ebfda26 100644
--- a/src/rpc/rawtransaction.cpp
+++ b/src/rpc/rawtransaction.cpp
@@ -883,8 +883,8 @@ UniValue sendrawtransaction(const JSONRPCRequest& request)
CMutableTransaction mtx;
if (!DecodeHexTx(mtx, request.params[0].get_str()))
throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed");
- CTransaction tx(std::move(mtx));
- uint256 hashTx = tx.GetHash();
+ CTransactionRef tx(MakeTransactionRef(std::move(mtx)));
+ const uint256& hashTx = tx->GetHash();
bool fLimitFree = false;
CAmount nMaxRawTxFee = maxTxFee;
@@ -899,7 +899,7 @@ UniValue sendrawtransaction(const JSONRPCRequest& request)
// push to local node and sync with wallets
CValidationState state;
bool fMissingInputs;
- if (!AcceptToMemoryPool(mempool, state, tx, fLimitFree, &fMissingInputs, false, nMaxRawTxFee)) {
+ if (!AcceptToMemoryPool(mempool, state, std::move(tx), fLimitFree, &fMissingInputs, false, nMaxRawTxFee)) {
if (state.IsInvalid()) {
throw JSONRPCError(RPC_TRANSACTION_REJECTED, strprintf("%i: %s", state.GetRejectCode(), state.GetRejectReason()));
} else {