aboutsummaryrefslogtreecommitdiff
path: root/src/rpcrawtransaction.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2013-12-08 13:51:53 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2013-12-08 13:52:48 +0100
commit05e27c66411caa622815cc7cc7136dfd85370ab4 (patch)
tree983fe8073153218c28d756873daeaf4ec2293b16 /src/rpcrawtransaction.cpp
parentfbbed19b78e3055103cdff8d31d24ced7e7e561b (diff)
parent5094f8d46fe3a0f0bcee913d6f1586dcef35749e (diff)
downloadbitcoin-05e27c66411caa622815cc7cc7136dfd85370ab4.tar.xz
Merge pull request #3332
5094f8d Split off rpc_wallet_tests (Wladimir J. van der Laan) 829c920 Move CCryptoKeyStore to crypter.cpp (Wladimir J. van der Laan) ae6ea5a Update build-unix.md to mention --disable-wallet (Wladimir J. van der Laan) 4f9e993 Add --disable-wallet option to build system (Wladimir J. van der Laan) d004d72 Move CAddrDB frrom db to net (Wladimir J. van der Laan) 48ba56c Delimit code with #ifdef ENABLE_WALLET (Wladimir J. van der Laan) 991685d Move getinfo to rpcnet.cpp (Wladimir J. van der Laan) bbb0936 Move HelpExample* from rpcwallet to rpcserver (Wladimir J. van der Laan)
Diffstat (limited to 'src/rpcrawtransaction.cpp')
-rw-r--r--src/rpcrawtransaction.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/rpcrawtransaction.cpp b/src/rpcrawtransaction.cpp
index a45c2cc1f3..86025918ef 100644
--- a/src/rpcrawtransaction.cpp
+++ b/src/rpcrawtransaction.cpp
@@ -8,7 +8,12 @@
#include "init.h"
#include "net.h"
#include "uint256.h"
+#include "core.h"
+#include "main.h"
+#include "keystore.h"
+#ifdef ENABLE_WALLET
#include "wallet.h"
+#endif
#include <stdint.h>
@@ -190,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)
@@ -303,6 +309,7 @@ Value listunspent(const Array& params, bool fHelp)
return results;
}
+#endif
Value createrawtransaction(const Array& params, bool fHelp)
{
@@ -508,7 +515,9 @@ 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"
@@ -605,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)
@@ -662,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)