Skip to content

Commit 8eb38eb

Browse files
committed
Show signatures for lastblock in /api/node/status
1 parent 8bb4151 commit 8eb38eb

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

apps/tpnode/src/tpnode_httpapi.erl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,16 @@ h(Method, [<<"api">>|Path], Req) ->
122122
h(<<"GET">>, [<<"node">>, <<"status">>], Req) ->
123123
Chain=chainsettings:get_val(mychain),
124124
#{hash:=Hash,
125+
sign:=Signatures,
125126
header:=Header1}=Blk=blockchain:last_meta(),
127+
BlSig=[ begin
128+
V=proplists:get_value(pubkey,maps:get(extra,E)),
129+
case chainsettings:is_net_node(V) of
130+
{true, N} -> N;
131+
_ -> hex:encode(V)
132+
end
133+
end || E<-Signatures ],
134+
126135
Temp=maps:get(temporary,Blk,false),
127136
BinPacker=packer(Req),
128137
Header=maps:map(
@@ -218,6 +227,7 @@ h(<<"GET">>, [<<"node">>, <<"status">>], Req) ->
218227
chain=>Chain,
219228
hash=>BinPacker(Hash),
220229
header=>Header,
230+
signatures=> BlSig,
221231
temporary=>Temp
222232
},
223233
is_sync => try

0 commit comments

Comments
 (0)