aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2017-03-29 10:45:27 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2017-03-29 10:45:54 +0200
commitb768202695a090a48b77ce9873267d5ec29b8845 (patch)
tree9956aae990f0ca752413aeb93e2979b567138248 /src
parent37bf0d5b381f95da833b3df8b76eca16a63a9010 (diff)
parentfa7555b16a4e279f8f04c06f76a315e4c194ad79 (diff)
downloadbitcoin-b768202695a090a48b77ce9873267d5ec29b8845.tar.xz
Merge #10101: [0.14] backports
fa7555b doc: Add release notes for RPC createraw break (MarcoFalke) 142fbb2 rpc: Rename first named arg of createrawtransaction (MarcoFalke) fc3d7db Optimize GetWitnessHash() for non-segwit transactions (Suhas Daftuar) e9611d1 depends: fix zlib build on osx (Cory Fields) ddc2dd1 Ensure an item exists on the rpcconsole stack before adding (Andrew Chow) 4d8e660 Trivial: Fix typo in help getrawtransaction RPC (James Evans) Tree-SHA512: 4351b07a7477315aafbbbc632503a000fb5832d1b3617c7aff78603f4c53f581599a0c9b098d39d35adb8aa58769cf80298baf2eea278c32a662ec8c8fba3ceb
Diffstat (limited to 'src')
-rw-r--r--src/primitives/transaction.cpp3
-rw-r--r--src/qt/rpcconsole.cpp4
-rw-r--r--src/rpc/client.cpp2
-rw-r--r--src/rpc/rawtransaction.cpp8
4 files changed, 12 insertions, 5 deletions
diff --git a/src/primitives/transaction.cpp b/src/primitives/transaction.cpp
index 790bc71d14..28ef1fb464 100644
--- a/src/primitives/transaction.cpp
+++ b/src/primitives/transaction.cpp
@@ -69,6 +69,9 @@ uint256 CTransaction::ComputeHash() const
uint256 CTransaction::GetWitnessHash() const
{
+ if (!HasWitness()) {
+ return GetHash();
+ }
return SerializeHash(*this, SER_GETHASH, 0);
}
diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp
index 60406c2059..001f199264 100644
--- a/src/qt/rpcconsole.cpp
+++ b/src/qt/rpcconsole.cpp
@@ -175,6 +175,10 @@ bool RPCConsole::RPCParseCommandLine(std::string &strResult, const std::string &
nDepthInsideSensitive = 1;
filter_begin_pos = chpos;
}
+ // Make sure stack is not empty before adding something
+ if (stack.empty()) {
+ stack.push_back(std::vector<std::string>());
+ }
stack.back().push_back(strArg);
};
diff --git a/src/rpc/client.cpp b/src/rpc/client.cpp
index 5bdd84e555..56d1495919 100644
--- a/src/rpc/client.cpp
+++ b/src/rpc/client.cpp
@@ -83,7 +83,7 @@ static const CRPCConvertParam vRPCConvertParams[] =
{ "getblockheader", 1, "verbose" },
{ "gettransaction", 1, "include_watchonly" },
{ "getrawtransaction", 1, "verbose" },
- { "createrawtransaction", 0, "transactions" },
+ { "createrawtransaction", 0, "inputs" },
{ "createrawtransaction", 1, "outputs" },
{ "createrawtransaction", 2, "locktime" },
{ "signrawtransaction", 1, "prevtxs" },
diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp
index bf16f27498..0fabb9f5a8 100644
--- a/src/rpc/rawtransaction.cpp
+++ b/src/rpc/rawtransaction.cpp
@@ -139,7 +139,7 @@ UniValue getrawtransaction(const JSONRPCRequest& request)
"\nArguments:\n"
"1. \"txid\" (string, required) The transaction id\n"
- "2. verbose (bool, optional, default=false) If true, return a string, other return a json object\n"
+ "2. verbose (bool, optional, default=false) If false, return a string, otherwise return a json object\n"
"\nResult (if verbose is not set or set to false):\n"
"\"data\" (string) The serialized, hex-encoded data for 'txid'\n"
@@ -361,7 +361,7 @@ UniValue createrawtransaction(const JSONRPCRequest& request)
"it is not stored in the wallet or transmitted to the network.\n"
"\nArguments:\n"
- "1. \"inputs\" (string, required) A json array of json objects\n"
+ "1. \"inputs\" (array, required) A json array of json objects\n"
" [\n"
" {\n"
" \"txid\":\"id\", (string, required) The transaction id\n"
@@ -370,7 +370,7 @@ UniValue createrawtransaction(const JSONRPCRequest& request)
" } \n"
" ,...\n"
" ]\n"
- "2. \"outputs\" (string, required) a json object with outputs\n"
+ "2. \"outputs\" (object, required) a json object with outputs\n"
" {\n"
" \"address\": x.xxx, (numeric or string, required) The key is the bitcoin address, the numeric value (can be string) is the " + CURRENCY_UNIT + " amount\n"
" \"data\": \"hex\" (string, required) The key is \"data\", the value is hex encoded data\n"
@@ -932,7 +932,7 @@ static const CRPCCommand commands[] =
{ // category name actor (function) okSafeMode
// --------------------- ------------------------ ----------------------- ----------
{ "rawtransactions", "getrawtransaction", &getrawtransaction, true, {"txid","verbose"} },
- { "rawtransactions", "createrawtransaction", &createrawtransaction, true, {"transactions","outputs","locktime"} },
+ { "rawtransactions", "createrawtransaction", &createrawtransaction, true, {"inputs","outputs","locktime"} },
{ "rawtransactions", "decoderawtransaction", &decoderawtransaction, true, {"hexstring"} },
{ "rawtransactions", "decodescript", &decodescript, true, {"hexstring"} },
{ "rawtransactions", "sendrawtransaction", &sendrawtransaction, false, {"hexstring","allowhighfees"} },