diff options
author | MacroFake <falke.marco@gmail.com> | 2022-06-28 08:17:29 +0200 |
---|---|---|
committer | MacroFake <falke.marco@gmail.com> | 2022-06-28 08:17:32 +0200 |
commit | ee3ba5a76f4883e7d1425bda077ddfb3149b9a51 (patch) | |
tree | 0e0ffb9cb7c0637dbb333e581634b85e06173189 | |
parent | 2111f32f2a6998531871e7792b5208992868ba7f (diff) | |
parent | baf4efe02f363b70011b04cadd2d7aace18d48e9 (diff) |
Merge bitcoin/bitcoin#25485: rpc: Use enum instead of string for `filtertype_name`
baf4efe02f363b70011b04cadd2d7aace18d48e9 rpc: use enum instead of string for filter type (w0xlt)
Pull request description:
This PR changes the `getblockfilter` RPC to use `BlockFilterType` enum instead of a repeated string for `filtertype_name`.
ACKs for top commit:
furszy:
ACK baf4efe0
brunoerg:
ACK baf4efe02f363b70011b04cadd2d7aace18d48e9
Tree-SHA512: 31c79c0a5f0b17fd69b399bb026f523003b656733d6b7d5ffe665921a8cc0f1e0334d2e465145cd89fbd85e196059cf56f4f11563bbc92948b0606080ca76524
-rw-r--r-- | src/rpc/blockchain.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp index 9766a237c7..af9458206e 100644 --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -2177,7 +2177,7 @@ static RPCHelpMan getblockfilter() "\nRetrieve a BIP 157 content filter for a particular block.\n", { {"blockhash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The hash of the block"}, - {"filtertype", RPCArg::Type::STR, RPCArg::Default{"basic"}, "The type name of the filter"}, + {"filtertype", RPCArg::Type::STR, RPCArg::Default{BlockFilterTypeName(BlockFilterType::BASIC)}, "The type name of the filter"}, }, RPCResult{ RPCResult::Type::OBJ, "", "", @@ -2192,7 +2192,7 @@ static RPCHelpMan getblockfilter() [&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue { uint256 block_hash = ParseHashV(request.params[0], "blockhash"); - std::string filtertype_name = "basic"; + std::string filtertype_name = BlockFilterTypeName(BlockFilterType::BASIC); if (!request.params[1].isNull()) { filtertype_name = request.params[1].get_str(); } |