From 19f55b42ab08df53078610c616bf5a740b81add4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 8 Jul 2019 07:27:52 -1100 Subject: [PATCH] Error code separation --- src/komodo_nSPV.h | 5 ++--- src/komodo_nSPV_superlite.h | 10 +++++----- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/komodo_nSPV.h b/src/komodo_nSPV.h index ba59252cc..b7b38cf57 100644 --- a/src/komodo_nSPV.h +++ b/src/komodo_nSPV.h @@ -16,11 +16,10 @@ // todo: -// pubkeys extract -// headers "sync" +// headers "sync" make sure it connects to prior blocks to notarization. use getinfo hdrht to get missing hdrs + // interest calculations are currently just using what is returned, it should calculate it from scratch -// need to validate incoming data and update only if it is valid and more recent // make sure to sanity check all vector lengths on receipt // make sure no files are updated (this is to allow nSPV=1 and later nSPV=0 without affecting database) diff --git a/src/komodo_nSPV_superlite.h b/src/komodo_nSPV_superlite.h index 2b7f5b688..813390c01 100644 --- a/src/komodo_nSPV_superlite.h +++ b/src/komodo_nSPV_superlite.h @@ -601,9 +601,9 @@ int32_t NSPV_gettransaction(int32_t skipvalidation,int32_t vout,uint256 txid,int return(-1); } else if ( NSPV_txextract(tx,NSPV_txproofresult.tx,NSPV_txproofresult.txlen) < 0 || NSPV_txproofresult.txlen <= 0 ) - retval = -20; + retval = -2000; else if ( skipvalidation == 0 && NSPV_txproofresult.unspentvalue <= 0 ) - retval = -21; + retval = -2001; else if ( skipvalidation == 0 ) { if ( NSPV_txproofresult.txprooflen > 0 ) @@ -633,11 +633,11 @@ int32_t NSPV_gettransaction(int32_t skipvalidation,int32_t vout,uint256 txid,int if ( proofroot != NSPV_ntzsproofresult.common.hdrs[offset].hashMerkleRoot ) { fprintf(stderr,"prooflen.%d proofroot.%s vs %s\n",NSPV_txproofresult.txprooflen,proofroot.GetHex().c_str(),NSPV_ntzsproofresult.common.hdrs[offset].hashMerkleRoot.GetHex().c_str()); - retval = -23; + retval = -2003; } } - } else retval = -22; - } else retval = -24; + } else retval = -2002; + } else retval = -2004; } return(retval); }