Skip to content

Commit a2f1ebb

Browse files
authored
Merge pull request #876 from evoskuil/master
Use variant response types.
2 parents 04b39ff + 9b5b454 commit a2f1ebb

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

include/bitcoin/node/protocols/protocol_explore.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class BCN_API protocol_explore
5454
enum targets
5555
{
5656
/// /v[]/block/hash/[bkhash] {1}
57-
/// /v[]/block/height/[height] {1}s
57+
/// /v[]/block/height/[height] {1}
5858
block,
5959

6060
/// /v[]/block/hash/[bkhash]/filter {1}
@@ -66,8 +66,8 @@ class BCN_API protocol_explore
6666
header,
6767

6868
/// /v[]/transaction/hash/[txhash] {1}
69-
/// /v[]/block/hash/[bkhash]/transaction/[position] {1}
70-
/// /v[]/block/height/[height]/transaction/[position] {1}
69+
/// /v[]/block/hash/[bkhash]/transaction/position/[position] {1}
70+
/// /v[]/block/height/[height]/transaction/position/[position] {1}
7171
transaction,
7272

7373
/// /v[]/block/hash/[bkhash]/transactions {all txs in the block}

src/protocols/protocol_explore.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,23 +120,23 @@ void protocol_explore::handle_receive_get(const code& ec,
120120
{
121121
if (const auto ptr = query.get_header(query.to_header(hash)))
122122
{
123-
send_json(*request, value_from(*ptr));
123+
send_json(*request, value_from(ptr));
124124
return;
125125
}
126126
}
127127
else if (bk)
128128
{
129129
if (const auto ptr = query.get_block(query.to_header(hash), wit))
130130
{
131-
send_json(*request, value_from(*ptr));
131+
send_json(*request, value_from(ptr));
132132
return;
133133
}
134134
}
135135
else
136136
{
137137
if (const auto ptr = query.get_transaction(query.to_tx(hash), wit))
138138
{
139-
send_json(*request, value_from(*ptr));
139+
send_json(*request, value_from(ptr));
140140
return;
141141
}
142142
}
@@ -256,7 +256,7 @@ void protocol_explore::send_text(const request& request,
256256
std::string&& hexidecimal) NOEXCEPT
257257
{
258258
BC_ASSERT_MSG(stranded(), "strand");
259-
string_response response{ status::ok, request.version() };
259+
response response{ status::ok, request.version() };
260260
add_common_headers(response, request);
261261
response.set(field::content_type, from_mime_type(text));
262262
response.body() = std::move(hexidecimal);
@@ -268,7 +268,7 @@ void protocol_explore::send_data(const request& request,
268268
data_chunk&& bytes) NOEXCEPT
269269
{
270270
BC_ASSERT_MSG(stranded(), "strand");
271-
data_response response{ status::ok, request.version() };
271+
response response{ status::ok, request.version() };
272272
add_common_headers(response, request);
273273
response.set(field::content_type, from_mime_type(data));
274274
response.body() = std::move(bytes);

src/protocols/protocol_html.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ void protocol_html::send_file(const request& request, file&& file,
8585
BC_ASSERT_MSG(stranded(), "strand");
8686
BC_ASSERT_MSG(file.is_open(), "sending closed file handle");
8787

88-
file_response response{ status::ok, request.version() };
88+
response response{ status::ok, request.version() };
8989
add_common_headers(response, request);
9090

9191
response.set(field::content_type, from_mime_type(type));

0 commit comments

Comments
 (0)