Merge bitcoin/bitcoin#28890: rpc: Remove deprecated -rpcserialversion

fa46cc22bc Remove deprecated -rpcserialversion (MarcoFalke)

Pull request description:

  The flag is problematic for many reasons:

  * It is deprecated
  * It is a global flag, requiring a restart to change, as opposed to a flag that can be set on each RPC invocation
  * It may be hidden in config files by accident, hard to debug, causing LND crashes and bugs, see https://github.com/bitcoin/bitcoin/issues/28730#issuecomment-1780940868
  * It makes performance improvements harder to implement: https://github.com/bitcoin/bitcoin/pull/17529#issuecomment-556082818

  Fix all issues by removing it.

  If there is a use-case, likely a per-RPC flag can be added, if needed.

ACKs for top commit:
  ajtowns:
    crACK fa46cc22bc
  TheCharlatan:
    lgtm ACK fa46cc22bc

Tree-SHA512: 96ba1c60356ce93954fe5c2a59045771c6d1516ad0d9dc436ef1800a1f1b0153f0d5fb78ca99d53ad54ba25fbce36962bdf1d4325aceedfc8154a61347a6a915
This commit is contained in:
fanquake
2024-01-05 10:37:42 +00:00
14 changed files with 19 additions and 80 deletions

View File

@@ -316,7 +316,7 @@ static bool rest_block(const std::any& context,
switch (rf) {
case RESTResponseFormat::BINARY: {
DataStream ssBlock;
ssBlock << RPCTxSerParams(block);
ssBlock << TX_WITH_WITNESS(block);
std::string binaryBlock = ssBlock.str();
req->WriteHeader("Content-Type", "application/octet-stream");
req->WriteReply(HTTP_OK, binaryBlock);
@@ -325,7 +325,7 @@ static bool rest_block(const std::any& context,
case RESTResponseFormat::HEX: {
DataStream ssBlock;
ssBlock << RPCTxSerParams(block);
ssBlock << TX_WITH_WITNESS(block);
std::string strHex = HexStr(ssBlock) + "\n";
req->WriteHeader("Content-Type", "text/plain");
req->WriteReply(HTTP_OK, strHex);
@@ -722,7 +722,7 @@ static bool rest_tx(const std::any& context, HTTPRequest* req, const std::string
switch (rf) {
case RESTResponseFormat::BINARY: {
DataStream ssTx;
ssTx << RPCTxSerParams(tx);
ssTx << TX_WITH_WITNESS(tx);
std::string binaryTx = ssTx.str();
req->WriteHeader("Content-Type", "application/octet-stream");
@@ -732,7 +732,7 @@ static bool rest_tx(const std::any& context, HTTPRequest* req, const std::string
case RESTResponseFormat::HEX: {
DataStream ssTx;
ssTx << RPCTxSerParams(tx);
ssTx << TX_WITH_WITNESS(tx);
std::string strHex = HexStr(ssTx) + "\n";
req->WriteHeader("Content-Type", "text/plain");