From 7bacc426597cf8388f0bc3163f0e5a4b62734604 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 1 Oct 2016 18:21:25 -0300 Subject: [PATCH] test --- iguana/iguana.sources | 2 +- iguana/iguana777.c | 4 ---- iguana/iguana_notary.c | 21 +++++++++++++++++++++ iguana/iguana_sign.c | 2 +- iguana/iguana_unspents.c | 8 ++++++-- 5 files changed, 29 insertions(+), 8 deletions(-) create mode 100755 iguana/iguana_notary.c diff --git a/iguana/iguana.sources b/iguana/iguana.sources index 0c258c886..f15ef0117 100755 --- a/iguana/iguana.sources +++ b/iguana/iguana.sources @@ -1,2 +1,2 @@ -SOURCES := iguana_bundles.c iguana_mofn.c iguana_stake.c iguana_interpreter.c mini-gmp.c main.c iguana_payments.c iguana_spendvectors.c iguana_sign.c iguana_txidfind.c iguana_realtime.c iguana_volatiles.c peggy_price.c iguana_chains.c iguana_ramchain.c iguana_secp.c pangea_api.c peggy_ramkv.c iguana_exchanges.c iguana_recv.c pangea_bets.c peggy_serdes.c SuperNET_keys.c iguana_rpc.c pangea_hand.c peggy_tx.c cards777.c iguana_init.c iguana_scripts.c pangea_json.c peggy_txind.c iguana777.c iguana_tradebots.c pangea_summary.c peggy_update.c iguana_accept.c iguana_json.c iguana_tx.c peggy.c poker.c iguana_bitmap.c iguana_msg.c iguana_unspents.c peggy_accts.c ramchain_api.c iguana_blocks.c iguana_peers.c iguana_wallet.c peggy_consensus.c ../gecko/gecko.c ../basilisk/basilisk.c ../datachain/datachain.c secp256k1/src/secp256k1.c \ No newline at end of file +SOURCES := iguana_notary.c iguana_bundles.c iguana_mofn.c iguana_stake.c iguana_interpreter.c mini-gmp.c main.c iguana_payments.c iguana_spendvectors.c iguana_sign.c iguana_txidfind.c iguana_realtime.c iguana_volatiles.c peggy_price.c iguana_chains.c iguana_ramchain.c iguana_secp.c pangea_api.c peggy_ramkv.c iguana_exchanges.c iguana_recv.c pangea_bets.c peggy_serdes.c SuperNET_keys.c iguana_rpc.c pangea_hand.c peggy_tx.c cards777.c iguana_init.c iguana_scripts.c pangea_json.c peggy_txind.c iguana777.c iguana_tradebots.c pangea_summary.c peggy_update.c iguana_accept.c iguana_json.c iguana_tx.c peggy.c poker.c iguana_bitmap.c iguana_msg.c iguana_unspents.c peggy_accts.c ramchain_api.c iguana_blocks.c iguana_peers.c iguana_wallet.c peggy_consensus.c ../gecko/gecko.c ../basilisk/basilisk.c ../datachain/datachain.c secp256k1/src/secp256k1.c \ No newline at end of file diff --git a/iguana/iguana777.c b/iguana/iguana777.c index 8dfdafe00..c175aeb15 100755 --- a/iguana/iguana777.c +++ b/iguana/iguana777.c @@ -1232,7 +1232,3 @@ char *busdata_sync(uint32_t *noncep,char *jsonstr,char *broadcastmode,char *dest return(0); } -// getnewaddress, setaccount, validate address, restart, validate address - -// importprivkey, setaccount, validate, restart, validate - diff --git a/iguana/iguana_notary.c b/iguana/iguana_notary.c new file mode 100755 index 000000000..e173f86aa --- /dev/null +++ b/iguana/iguana_notary.c @@ -0,0 +1,21 @@ +/****************************************************************************** + * Copyright © 2014-2016 The SuperNET Developers. * + * * + * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * + * the top-level directory of this distribution for the individual copyright * + * holder information and the developer policies on copyright and licensing. * + * * + * Unless otherwise agreed in a custom licensing agreement, no part of the * + * SuperNET software, including this file may be copied, modified, propagated * + * or distributed except according to the terms contained in the LICENSE file * + * * + * Removal or modification of this copyright notice is prohibited. * + * * + ******************************************************************************/ + +#include "iguana777.h" + + +#include "../includes/iguana_apidefs.h" + +#include "../includes/iguana_apiundefs.h" diff --git a/iguana/iguana_sign.c b/iguana/iguana_sign.c index 9ab56628e..dd9b44d59 100755 --- a/iguana/iguana_sign.c +++ b/iguana/iguana_sign.c @@ -950,7 +950,7 @@ int32_t bitcoin_verifyvins(struct iguana_info *coin,int32_t height,bits256 *sign memset(signedtxidp,0,sizeof(*signedtxidp)); for (vini=0; vinitx_in; vini++) { - if ( V->p2shscript != 0 && V->p2shlen != 0 ) + if ( V->p2shscript[0] != 0 && V->p2shlen != 0 ) { script = V->p2shscript; scriptlen = V->p2shlen; diff --git a/iguana/iguana_unspents.c b/iguana/iguana_unspents.c index 03d360a8f..3e5a295db 100755 --- a/iguana/iguana_unspents.c +++ b/iguana/iguana_unspents.c @@ -517,7 +517,11 @@ int64_t iguana_RTpkhashbalance(struct supernet_info *myinfo,struct iguana_info * printf("iguana_pkhashbalance.[%d] %d: unexpected null spents.%p or rdata.%p\n",ramchain->height,(coin->bundlescount-1)*coin->chain->bundlesize,ramchain->Uextras,rdata); } iguana_volatilesmap(myinfo,coin,ramchain); - //return(0); + if ( ramchain->Uextras == 0 || (rdata= ramchain->H.data) == 0 ) + { + printf("couldnt map ramchain %d\n",ramchain->height); + return(0); + } } unspentind = lastpt.unspentind; U = RAMCHAIN_PTR(rdata,Uoffset); @@ -573,7 +577,7 @@ int64_t iguana_RTpkhashbalance(struct supernet_info *myinfo,struct iguana_info * } unspentind = U2[unspentind].prevunspentind; } - if ( 0 && llabs(spent - checkval - RTspend) > SMALLVAL ) + if ( 0 && llabs((int64_t)spent - (int64_t)checkval - (int64_t)RTspend) > SMALLVAL ) printf("spend %s: [%d] deposits %.8f spent %.8f check %.8f (%.8f) vs A2[%u] %.8f\n",lastheight==IGUANA_MAXHEIGHT?"checkerr":"",lastpt.hdrsi,dstr(deposits),dstr(spent),dstr(checkval)+dstr(RTspend),dstr(*spentp),pkind,dstr(A2[pkind].total)); } (*spentp) = spent;