From 122170f3042a1b8c7d3bd30506ad1b7876a812e9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 31 Oct 2017 12:30:20 +0200 Subject: [PATCH] Test --- iguana/exchanges/LP_rpc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 0e71e62be..5194b40f6 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -220,12 +220,13 @@ cJSON *LP_NXT_message(char *method,uint64_t txnum,char *passphrase) return(retjson); } -cJSON *LP_NXT_decrypt(char *account,char *data,char *nonce,char *passphrase) +cJSON *LP_NXT_decrypt(uint64_t txnum,char *account,char *data,char *nonce,char *passphrase) { char url[1024],*retstr; cJSON *retjson = 0; if ( account != 0 && data != 0 && nonce != 0 && passphrase != 0 ) { sprintf(url,"http://127.0.0.1:7876/nxt?requestType=getAccountId&secretPhrase=%s",passphrase); + sprintf(url,"http://127.0.0.1:7876/nxt?requestType=readMessage&transaction=%llu&secretPhrase=%s",(long long)txnum,passphrase); if ( (retstr= issue_curlt(url,LP_HTTP_TIMEOUT)) != 0 ) printf("%s\n",retstr); sprintf(url,"http://127.0.0.1:7876/nxt?requestType=decryptFrom&account=%s&secretPhrase=%s&data=%s&nonce=%s",account,passphrase,data,nonce); @@ -288,7 +289,7 @@ char *account = "NXT-MRBN-8DFH-PFMK-A4DBM"; if ( (encjson= jobj(attach,"encryptedMessage")) != 0 ) { msgstr = "encryptedMessage";//jstr(encjson,"data"); - if ( (decjson= LP_NXT_decrypt(account,jstr(encjson,"data"),jstr(encjson,"nonce"),passphrase)) != 0 ) + if ( (decjson= LP_NXT_decrypt(txnum,account,jstr(encjson,"data"),jstr(encjson,"nonce"),passphrase)) != 0 ) { printf("%s\n",jprint(decjson,0)); free_json(decjson);