diff options
| author | Pieter Wuille <[email protected]> | 2016-11-30 14:50:20 -0800 |
|---|---|---|
| committer | Pieter Wuille <[email protected]> | 2016-12-02 18:28:22 -0800 |
| commit | 42fd8dee302fec55ba0970e2f1378edc2797e4ff (patch) | |
| tree | 0b2b5cb6be13f876f5b0fc6060da144213cda6bc /src/wallet/rpcwallet.cpp | |
| parent | Make CWalletTx store a CTransactionRef instead of inheriting (diff) | |
| download | discoin-42fd8dee302fec55ba0970e2f1378edc2797e4ff.tar.xz discoin-42fd8dee302fec55ba0970e2f1378edc2797e4ff.zip | |
Make DecodeHexTx return a CMutableTransaction
Diffstat (limited to 'src/wallet/rpcwallet.cpp')
| -rw-r--r-- | src/wallet/rpcwallet.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index f31a28c4d..9e32b6751 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -2557,17 +2557,16 @@ UniValue fundrawtransaction(const JSONRPCRequest& request) } // parse hex string from parameter - CTransaction origTx; - if (!DecodeHexTx(origTx, request.params[0].get_str(), true)) + CMutableTransaction tx; + if (!DecodeHexTx(tx, request.params[0].get_str(), true)) throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed"); - if (origTx.vout.size() == 0) + if (tx.vout.size() == 0) throw JSONRPCError(RPC_INVALID_PARAMETER, "TX must have at least one output"); - if (changePosition != -1 && (changePosition < 0 || (unsigned int)changePosition > origTx.vout.size())) + if (changePosition != -1 && (changePosition < 0 || (unsigned int)changePosition > tx.vout.size())) throw JSONRPCError(RPC_INVALID_PARAMETER, "changePosition out of bounds"); - CMutableTransaction tx(origTx); CAmount nFeeOut; string strFailReason; |