Merge #9264: 0.13.2 backports
f26dab7Adapt ZMQ/rest serialization to take rpcserialversion arg (instagibbs)21ccb9fAdd option to return non-segwit serialization via rpc (Gregory Sanders)a710a43Improvement of documentation of command line parameter 'whitelist' (wodry)58eab24[qa] rpc-tests: Apply random offset to portseed (MarcoFalke)ecd7db5[qa] test_framework: Exit when tmpdir exists (MarcoFalke)387ec9dAdd script tests for FindAndDelete in pre-segwit and segwit scripts (Johnson Lau)87fbcedChange all instance of 'GMT epoch' to 'Unix epoch' (matthias)b1e978cinstance of 'mem pool' to 'mempool' (S. Matthew English)ff55a2dUpdate gitian signing key of jl2012 (Johnson Lau)28d0f22Fix calculation of number of bound sockets to use (Matt Corallo)396c405Include select.h when WIN32 is not defined (Ivo van der Sangen)eebc699bench: Fix subtle counting issue when rescaling iteration count (Wladimir J. van der Laan)0c09d9fSend tip change notification from invalidateblock (Russell Yanofsky)6f7841cqt: Avoid OpenSSL certstore-related memory leak (Wladimir J. van der Laan)e5ad693qt: Avoid shutdownwindow-related memory leak (Wladimir J. van der Laan)e4bea4fqt: Avoid splash-screen related memory leak (Wladimir J. van der Laan)c12f4e9qt: Prevent thread/memory leak on exiting RPCConsole (Wladimir J. van der Laan)dc46b10qt: Plug many memory leaks (Wladimir J. van der Laan)ff423cc[Qt] Clean up and fix coincontrol tree widget handling (Wladimir J. van der Laan)6d70a73[Qt] fix coincontrol sort issue (Jonas Schnelli)3fffbf7Doxygen: Set PROJECT_NAME = "Bitcoin Core" (MarcoFalke)f82c81bfix getnettotals RPC description about timemillis. (Masahiko Hyuga)6fe3981net: don't send feefilter messages before the version handshake is complete (Cory Fields)5f3a12cqt: Use correct conversion function for boost::path datadir (Wladimir J. van der Laan)08d1c90Missed one "return false" in recent refactoring in #9067 (UdjinM6)f27596aEvery main()/exit() should return/use one of EXIT_ codes instead of magic numbers (UdjinM6)f85ee01Fix exit codes: - `--help`, `--version` etc should exit with `0` i.e. no error ("not enough args" case should still trigger an error) - error reading config file should exit with `1` (UdjinM6)5bcb05d[rpc] ParseHash: Fail when length is not 64 (MarcoFalke)973ca1eFix doxygen comment: the transaction is returned in txOut (Pavel Janík)6f86b53[Qt] make warnings label selectable (Jonas Schnelli)106da69Sync bitcoin-tx with tx version policy (BtcDrak)12428b4add software-properties-common (Steven)40169dcSet minimum required Boost to 1.47.0 (fanquake)c134d92[build-aux] Boost_Base serial 27 (fanquake)4a974b2Simple Update to File 'bitcoin-qt.desktop' (matthias)975ab12Update INSTALL landing redirection notice for build instructions. (randy-waterhouse)3a3bcbfUse RelevantServices instead of node_network in AttemptToEvict. (Gregory Maxwell)ca1fd75Make orphan parent fetching ask for witnesses. (Gregory Maxwell)b96a8f7[qa] Test getblocktemplate default_witness_commitment (Suhas Daftuar)99477c7Always add default_witness_commitment with GBT client support (Pieter Wuille)da5a16bAlways drop the least preferred HB peer when adding a new one. (Gregory Maxwell)094848blog block size and weight correctly. (jnewbery)d1b4da9build: fix qt5.7 build under macOS (Cory Fields)
This commit is contained in:
@@ -607,7 +607,7 @@ UniValue getblock(const UniValue& params, bool fHelp)
|
||||
|
||||
if (!fVerbose)
|
||||
{
|
||||
CDataStream ssBlock(SER_NETWORK, PROTOCOL_VERSION);
|
||||
CDataStream ssBlock(SER_NETWORK, PROTOCOL_VERSION | RPCSerializationFlags());
|
||||
ssBlock << block;
|
||||
std::string strHex = HexStr(ssBlock.begin(), ssBlock.end());
|
||||
return strHex;
|
||||
@@ -719,7 +719,7 @@ UniValue gettxout(const UniValue& params, bool fHelp)
|
||||
"\nArguments:\n"
|
||||
"1. \"txid\" (string, required) The transaction id\n"
|
||||
"2. n (numeric, required) vout number\n"
|
||||
"3. includemempool (boolean, optional) Whether to include the mem pool\n"
|
||||
"3. includemempool (boolean, optional) Whether to include the mempool\n"
|
||||
"\nResult:\n"
|
||||
"{\n"
|
||||
" \"bestblock\" : \"hash\", (string) the block hash\n"
|
||||
|
||||
@@ -229,7 +229,7 @@ UniValue getmininginfo(const UniValue& params, bool fHelp)
|
||||
" \"difficulty\": xxx.xxxxx (numeric) The current difficulty\n"
|
||||
" \"errors\": \"...\" (string) Current errors\n"
|
||||
" \"networkhashps\": nnn, (numeric) The network hashes per second\n"
|
||||
" \"pooledtx\": n (numeric) The size of the mem pool\n"
|
||||
" \"pooledtx\": n (numeric) The size of the mempool\n"
|
||||
" \"testnet\": true|false (boolean) If using testnet or not\n"
|
||||
" \"chain\": \"xxxx\", (string) current network name as defined in BIP70 (main, test, regtest)\n"
|
||||
"}\n"
|
||||
@@ -683,7 +683,9 @@ UniValue getblocktemplate(const UniValue& params, bool fHelp)
|
||||
result.push_back(Pair("curtime", pblock->GetBlockTime()));
|
||||
result.push_back(Pair("bits", strprintf("%08x", pblock->nBits)));
|
||||
result.push_back(Pair("height", (int64_t)(pindexPrev->nHeight+1)));
|
||||
if (!pblocktemplate->vchCoinbaseCommitment.empty()) {
|
||||
|
||||
const struct BIP9DeploymentInfo& segwit_info = VersionBitsDeploymentInfo[Consensus::DEPLOYMENT_SEGWIT];
|
||||
if (!pblocktemplate->vchCoinbaseCommitment.empty() && setClientRules.find(segwit_info.name) != setClientRules.end()) {
|
||||
result.push_back(Pair("default_witness_commitment", HexStr(pblocktemplate->vchCoinbaseCommitment.begin(), pblocktemplate->vchCoinbaseCommitment.end())));
|
||||
}
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ UniValue getinfo(const UniValue& params, bool fHelp)
|
||||
" \"proxy\": \"host:port\", (string, optional) the proxy used by the server\n"
|
||||
" \"difficulty\": xxxxxx, (numeric) the current difficulty\n"
|
||||
" \"testnet\": true|false, (boolean) if the server is using testnet or not\n"
|
||||
" \"keypoololdest\": xxxxxx, (numeric) the timestamp (seconds since GMT epoch) of the oldest pre-generated key in the key pool\n"
|
||||
" \"keypoololdest\": xxxxxx, (numeric) the timestamp (seconds since Unix epoch) of the oldest pre-generated key in the key pool\n"
|
||||
" \"keypoolsize\": xxxx, (numeric) how many new keys are pre-generated\n"
|
||||
" \"unlocked_until\": ttt, (numeric) the timestamp in seconds since epoch (midnight Jan 1 1970 GMT) that the wallet is unlocked for transfers, or 0 if the wallet is locked\n"
|
||||
" \"paytxfee\": x.xxxx, (numeric) the transaction fee set in " + CURRENCY_UNIT + "/kB\n"
|
||||
|
||||
@@ -344,7 +344,7 @@ UniValue getnettotals(const UniValue& params, bool fHelp)
|
||||
"{\n"
|
||||
" \"totalbytesrecv\": n, (numeric) Total bytes received\n"
|
||||
" \"totalbytessent\": n, (numeric) Total bytes sent\n"
|
||||
" \"timemillis\": t, (numeric) Total cpu time\n"
|
||||
" \"timemillis\": t, (numeric) Current UNIX time in milliseconds\n"
|
||||
" \"uploadtarget\":\n"
|
||||
" {\n"
|
||||
" \"timeframe\": n, (numeric) Length of the measuring timeframe in seconds\n"
|
||||
|
||||
@@ -209,7 +209,7 @@ UniValue getrawtransaction(const UniValue& params, bool fHelp)
|
||||
if (!GetTransaction(hash, tx, Params().GetConsensus(), hashBlock, true))
|
||||
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "No information available about transaction");
|
||||
|
||||
string strHex = EncodeHexTx(tx);
|
||||
string strHex = EncodeHexTx(tx, RPCSerializationFlags());
|
||||
|
||||
if (!fVerbose)
|
||||
return strHex;
|
||||
|
||||
@@ -146,6 +146,8 @@ uint256 ParseHashV(const UniValue& v, string strName)
|
||||
strHex = v.get_str();
|
||||
if (!IsHex(strHex)) // Note: IsHex("") is false
|
||||
throw JSONRPCError(RPC_INVALID_PARAMETER, strName+" must be hexadecimal string (not '"+strHex+"')");
|
||||
if (64 != strHex.length())
|
||||
throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("%s must be of length %d (not %d)", strName, 64, strHex.length()));
|
||||
uint256 result;
|
||||
result.SetHex(strHex);
|
||||
return result;
|
||||
@@ -493,4 +495,12 @@ void RPCRunLater(const std::string& name, boost::function<void(void)> func, int6
|
||||
deadlineTimers.insert(std::make_pair(name, boost::shared_ptr<RPCTimerBase>(timerInterface->NewTimer(func, nSeconds*1000))));
|
||||
}
|
||||
|
||||
int RPCSerializationFlags()
|
||||
{
|
||||
int flag = 0;
|
||||
if (GetArg("-rpcserialversion", DEFAULT_RPC_SERIALIZE_VERSION) == 0)
|
||||
flag |= SERIALIZE_TRANSACTION_NO_WITNESS;
|
||||
return flag;
|
||||
}
|
||||
|
||||
CRPCTable tableRPC;
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
|
||||
#include <univalue.h>
|
||||
|
||||
static const unsigned int DEFAULT_RPC_SERIALIZE_VERSION = 1;
|
||||
|
||||
class CRPCCommand;
|
||||
|
||||
namespace RPCServer
|
||||
@@ -195,4 +197,7 @@ void InterruptRPC();
|
||||
void StopRPC();
|
||||
std::string JSONRPCExecBatch(const UniValue& vReq);
|
||||
|
||||
// Retrieves any serialization flags requested in command line argument
|
||||
int RPCSerializationFlags();
|
||||
|
||||
#endif // BITCOIN_RPCSERVER_H
|
||||
|
||||
Reference in New Issue
Block a user