diff options
Diffstat (limited to 'src/rpcrawtransaction.cpp')
| -rw-r--r-- | src/rpcrawtransaction.cpp | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/src/rpcrawtransaction.cpp b/src/rpcrawtransaction.cpp index 2225e216d..837aee7ea 100644 --- a/src/rpcrawtransaction.cpp +++ b/src/rpcrawtransaction.cpp @@ -1,16 +1,19 @@ // Copyright (c) 2010 Satoshi Nakamoto -// Copyright (c) 2009-2013 The Bitcoin developers +// Copyright (c) 2009-2014 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. - - #include "base58.h" -#include "bitcoinrpc.h" +#include "core.h" #include "init.h" +#include "keystore.h" +#include "main.h" #include "net.h" +#include "rpcserver.h" #include "uint256.h" +#ifdef ENABLE_WALLET #include "wallet.h" +#endif #include <stdint.h> @@ -80,7 +83,7 @@ void TxToJSON(const CTransaction& tx, const uint256 hashBlock, Object& entry) out.push_back(Pair("value", ValueFromAmount(txout.nValue))); out.push_back(Pair("n", (boost::int64_t)i)); Object o; - ScriptPubKeyToJSON(txout.scriptPubKey, o, false); + ScriptPubKeyToJSON(txout.scriptPubKey, o, true); out.push_back(Pair("scriptPubKey", o)); vout.push_back(out); } @@ -192,6 +195,7 @@ Value getrawtransaction(const Array& params, bool fHelp) return result; } +#ifdef ENABLE_WALLET Value listunspent(const Array& params, bool fHelp) { if (fHelp || params.size() > 3) @@ -305,6 +309,7 @@ Value listunspent(const Array& params, bool fHelp) return results; } +#endif Value createrawtransaction(const Array& params, bool fHelp) { @@ -510,12 +515,14 @@ Value signrawtransaction(const Array& params, bool fHelp) "this transaction depends on but may not yet be in the block chain.\n" "The third optional argument (may be null) is an array of base58-encoded private\n" "keys that, if given, will be the only keys used to sign the transaction.\n" +#ifdef ENABLE_WALLET + HelpRequiringPassphrase() + "\n" +#endif "\nArguments:\n" "1. \"hexstring\" (string, required) The transaction hex string\n" "2. \"prevtxs\" (string, optional) An json array of previous dependent transaction outputs\n" - " [ (json array of json objects)\n" + " [ (json array of json objects, or 'null' if none provided)\n" " {\n" " \"txid\":\"id\", (string, required) The transaction id\n" " \"vout\":n, (numeric, required) The output number\n" @@ -525,7 +532,7 @@ Value signrawtransaction(const Array& params, bool fHelp) " ,...\n" " ]\n" "3. \"privatekeys\" (string, optional) A json array of base58-encoded private keys for signing\n" - " [ (json array of strings)\n" + " [ (json array of strings, or 'null' if none provided)\n" " \"privatekey\" (string) private key in base58-encoding\n" " ,...\n" " ]\n" @@ -607,8 +614,10 @@ Value signrawtransaction(const Array& params, bool fHelp) tempKeystore.AddKey(key); } } +#ifdef ENABLE_WALLET else EnsureWalletIsUnlocked(); +#endif // Add previous txouts given in the RPC call: if (params.size() > 1 && params[1].type() != null_type) @@ -664,7 +673,11 @@ Value signrawtransaction(const Array& params, bool fHelp) } } +#ifdef ENABLE_WALLET const CKeyStore& keystore = ((fGivenKeys || !pwalletMain) ? tempKeystore : *pwalletMain); +#else + const CKeyStore& keystore = tempKeystore; +#endif int nHashType = SIGHASH_ALL; if (params.size() > 3 && params[3].type() != null_type) |