Skip to content

Commit

Permalink
Merge #10101: [0.14] backports
Browse files Browse the repository at this point in the history
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
  • Loading branch information
laanwj committed Mar 29, 2017
2 parents 37bf0d5 + fa7555b commit b768202
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 7 deletions.
4 changes: 3 additions & 1 deletion depends/packages/zlib.mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ $(package)_sha256_hash=c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca11
define $(package)_set_vars
$(package)_build_opts= CC="$($(package)_cc)"
$(package)_build_opts+=CFLAGS="$($(package)_cflags) $($(package)_cppflags) -fPIC"
$(package)_build_opts+=AR="$($(package)_ar)"
$(package)_build_opts+=RANLIB="$($(package)_ranlib)"
$(package)_build_opts+=AR="$($(package)_ar)"
$(package)_build_opts_darwin+=AR="$($(package)_libtool)"
$(package)_build_opts_darwin+=ARFLAGS="-o"
endef

define $(package)_config_cmds
Expand Down
9 changes: 8 additions & 1 deletion doc/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,14 @@ Notable changes
Example item
-----------------------------------------------

0.13.x Change log
RPC changes
-----------

The first positional argument of `createrawtransaction` was renamed.
This interface change breaks compatibility with 0.14.0, when the named
arguments functionality, introduced in 0.14.0, is used.

0.14.x Change log
=================

Detailed release notes follow. This overview includes changes that affect
Expand Down
3 changes: 3 additions & 0 deletions src/primitives/transaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ uint256 CTransaction::ComputeHash() const

uint256 CTransaction::GetWitnessHash() const
{
if (!HasWitness()) {
return GetHash();
}
return SerializeHash(*this, SER_GETHASH, 0);
}

Expand Down
4 changes: 4 additions & 0 deletions src/qt/rpcconsole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};

Expand Down
2 changes: 1 addition & 1 deletion src/rpc/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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" },
Expand Down
8 changes: 4 additions & 4 deletions src/rpc/rawtransaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand All @@ -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"
Expand Down Expand Up @@ -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"} },
Expand Down

0 comments on commit b768202

Please sign in to comment.