mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01:00
Make AcceptToMemoryPool take CTransactionRef
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user