Browse Source
plugin: Use the json_add_secret wrapper to add the shared_secret
This was incorrectly handled before, hence the wrapper which checks
correctness of the arguments.
Signed-off-by: Christian Decker <decker.christian@gmail.com>
htlc_accepted_hook
Christian Decker
6 years ago
No known key found for this signature in database
GPG Key ID: 1416D83DC4F0E86D
2 changed files with
6 additions and
1 deletions
lightningd/peer_htlcs.c
wallet/test/run-wallet.c
@ -721,7 +721,7 @@ static void htlc_accepted_hook_serialize(struct htlc_accepted_hook_payload *p,
}
json_add_hex_talarr ( s , " next_onion " , p - > next_onion ) ;
json_add_hex ( s , " shared_secret " , & hin - > shared_secret , sizeof ( hin - > shared_secret ) ) ;
json_add_secret ( s , " shared_secret " , hin - > shared_secret ) ;
json_object_end ( s ) ;
json_object_start ( s , " htlc " ) ;
@ -254,6 +254,11 @@ void json_add_num(struct json_stream *result UNNEEDED, const char *fieldname UNN
void json_add_s32 ( struct json_stream * result UNNEEDED , const char * fieldname UNNEEDED ,
int32_t value UNNEEDED )
{ fprintf ( stderr , " json_add_s32 called! \n " ) ; abort ( ) ; }
/* Generated stub for json_add_secret */
void json_add_secret ( struct json_stream * response UNNEEDED ,
const char * fieldname UNNEEDED ,
const struct secret * secret UNNEEDED )
{ fprintf ( stderr , " json_add_secret called! \n " ) ; abort ( ) ; }
/* Generated stub for json_add_short_channel_id */
void json_add_short_channel_id ( struct json_stream * response UNNEEDED ,
const char * fieldname UNNEEDED ,