Merge pull request #531 from jl777/jl777

Jl777
This commit is contained in:
jl777
2018-03-05 10:24:02 +02:00
committed by GitHub
5 changed files with 13 additions and 15 deletions

View File

@@ -65,6 +65,7 @@ public:
};
#define FROM_CLI
#include "uint256.h"
#include "arith_uint256.h"

View File

@@ -1362,12 +1362,14 @@ void komodo_configfile(char *symbol,uint16_t port)
#endif
if ( (fp= fopen(fname,"rb")) == 0 )
{
#ifndef FROM_CLI
if ( (fp= fopen(fname,"wb")) != 0 )
{
fprintf(fp,"rpcuser=user%u\nrpcpassword=pass%s\nrpcport=%u\nserver=1\ntxindex=1\nrpcworkqueue=64\n",crc,password,port);
fclose(fp);
printf("Created (%s)\n",fname);
} else printf("Couldnt create (%s)\n",fname);
#endif
}
else
{
@@ -1442,19 +1444,6 @@ uint32_t komodo_assetmagic(char *symbol,uint64_t supply,uint8_t *extraptr,int32_
return(calc_crc32(crc0,buf,len));
}
/*int32_t komodo_shortflag(char *symbol)
{
int32_t i,shortflag = 0;
if ( symbol[0] == '-' )
{
shortflag = 1;
for (i=0; symbol[i+1]!=0; i++)
symbol[i] = symbol[i+1];
symbol[i] = 0;
}
return(shortflag);
}*/
uint16_t komodo_assetport(uint32_t magic,int32_t extralen)
{
if ( magic == 0x8de4eef9 )
@@ -1619,6 +1608,7 @@ void komodo_args(char *argv0)
for (i=0; i<4; i++)
sprintf(&magicstr[i<<1],"%02x",magic[i]);
magicstr[8] = 0;
#ifndef FROM_CLI
sprintf(fname,"gen%s",ASSETCHAINS_SYMBOL);
if ( (fp= fopen(fname,"wb")) != 0 )
{
@@ -1626,6 +1616,7 @@ void komodo_args(char *argv0)
fclose(fp);
//printf("created (%s)\n",fname);
} else printf("error creating (%s)\n",fname);
#endif
}
else
{

View File

@@ -737,7 +737,7 @@ bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime)
}
else if (!txin.IsFinal())
{
//printf("non-final txin seq.%x locktime.%u vs nTime.%u\n",txin.nSequence,(uint32_t)tx.nLockTime,(uint32_t)nBlockTime);
printf("non-final txin seq.%x locktime.%u vs nTime.%u\n",txin.nSequence,(uint32_t)tx.nLockTime,(uint32_t)nBlockTime);
return false;
}
}

View File

@@ -1129,7 +1129,10 @@ bool TransactionSignatureChecker::CheckLockTime(const CScriptNum& nLockTime) con
// Now that we know we're comparing apples-to-apples, the
// comparison is a simple numeric one.
if (nLockTime > (int64_t)txTo->nLockTime)
{
//fprintf(stderr,"CLTV error: nLockTime %llu > %u txTo->nLockTime\n",*(long long *)&nLockTime,(uint32_t)txTo->nLockTime);
return false;
}
// Finally the nLockTime feature can be disabled and thus
// CHECKLOCKTIMEVERIFY bypassed if every txin has been
@@ -1142,7 +1145,10 @@ bool TransactionSignatureChecker::CheckLockTime(const CScriptNum& nLockTime) con
// inputs, but testing just this input minimizes the data
// required to prove correct CHECKLOCKTIMEVERIFY execution.
if (txTo->vin[nIn].IsFinal())
{
//fprintf(stderr,"CLTV error: nonfinal vin.%d nSequence.%u vs %u\n",(int32_t)nIn,(uint32_t)txTo->vin[nIn].nSequence,(uint32_t)std::numeric_limits<uint32_t>::max());
return false;
}
return true;
}

View File

@@ -88,5 +88,5 @@ PREFIX="$(pwd)/depends/$BUILD/"
HOST="$HOST" BUILD="$BUILD" NO_RUST="$RUST_ARG" "$MAKE" "$@" -C ./depends/ V=1
./autogen.sh
CC="$CC" CXX="$CXX" ./configure --prefix="${PREFIX}" --host="$HOST" --build="$BUILD" "$RUST_ARG" "$HARDENING_ARG" "$LCOV_ARG" "$TEST_ARG" "$MINING_ARG" CXXFLAGS='-fwrapv -fno-strict-aliasing -Werror -g'
CC="$CC" CXX="$CXX" ./configure --prefix="${PREFIX}" --host="$HOST" --build="$BUILD" "$RUST_ARG" "$HARDENING_ARG" "$LCOV_ARG" "$TEST_ARG" "$MINING_ARG" CXXFLAGS='-fwrapv -fno-strict-aliasing -g'
"$MAKE" "$@" V=1