From dfb57be5ece1550fce47b06ae7c76c550e34402d Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 7 Apr 2018 20:48:53 +0300 Subject: [PATCH] Test --- src/komodo_bitcoind.h | 9 ++++++++- src/komodo_globals.h | 2 +- src/komodo_utils.h | 1 + 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/komodo_bitcoind.h b/src/komodo_bitcoind.h index 217ac7194..847ffceb4 100644 --- a/src/komodo_bitcoind.h +++ b/src/komodo_bitcoind.h @@ -990,10 +990,17 @@ int32_t komodo_validate_interest(const CTransaction &tx,int32_t txheight,uint32_ int32_t komodo_staked(uint256 *utxotxidp,int32_t *utxovoutp,uint64_t *utxovaluep,uint8_t *utxosig) { - *utxovaluep = 100000; + char *retstr; + *utxovaluep = 0; memset(utxotxidp,0,sizeof(*utxotxidp)); memset(utxovoutp,0,sizeof(*utxovoutp)); memset(utxosig,0,72); + if ( (retstr= komodo_issuemethod(KOMODO_USERPASS,"listunspent","[]",BITCOIND_PORT)) != 0 ) + { + fprintf(stderr,"listunspent.(%s)\n",retstr); + free(retstr); + *utxovaluep = 100000; + } return(72); } diff --git a/src/komodo_globals.h b/src/komodo_globals.h index 4f8433f03..cb8f61988 100644 --- a/src/komodo_globals.h +++ b/src/komodo_globals.h @@ -50,7 +50,7 @@ int32_t KOMODO_LASTMINED,prevKOMODO_LASTMINED,JUMBLR_PAUSE,ASSETCHAINS_CC; std::string NOTARY_PUBKEY,ASSETCHAINS_NOTARIES,ASSETCHAINS_OVERRIDE_PUBKEY; uint8_t NOTARY_PUBKEY33[33],ASSETCHAINS_OVERRIDE_PUBKEY33[33]; -char ASSETCHAINS_SYMBOL[KOMODO_ASSETCHAIN_MAXLEN]; +char ASSETCHAINS_SYMBOL[KOMODO_ASSETCHAIN_MAXLEN],ASSETCHAINS_USERPASS[4096]; uint16_t ASSETCHAINS_PORT; uint32_t ASSETCHAIN_INIT; uint32_t ASSETCHAINS_MAGIC = 2387029918; diff --git a/src/komodo_utils.h b/src/komodo_utils.h index 47da06c0d..f86a62a60 100644 --- a/src/komodo_utils.h +++ b/src/komodo_utils.h @@ -1422,6 +1422,7 @@ uint16_t komodo_userpass(char *userpass,char *symbol) { port = komodo_userpass(username,password,fp); sprintf(userpass,"%s:%s",username,password); + strcpy(ASSETCHAINS_USERPASS,userpass); fclose(fp); return((int32_t)strlen(userpass)); }