Browse Source

Merge remote-tracking branch 'origin/dev' into dpow2

pull/141/head
Team ChainStrike 6 years ago
parent
commit
a5ce7f8cf1
  1. 9
      qa/rpc-tests/dpow.py
  2. 10
      src/komodo_validation011.h

9
qa/rpc-tests/dpow.py

@ -28,10 +28,11 @@ class DPoWTest(BitcoinTestFramework):
result = rpc.getinfo() result = rpc.getinfo()
print result print result
# TODO: actually do notarizations on regtest and test for specific data # TODO: actually do notarizations on regtest and test for specific data
# TODO: does this have mainnet values somehow?
assert(result['notarized'] >= 0) # regtest should have no notarization data, this test makes sure we do not see mainnet values as well!
assert(result['notarizedhash']) assert_equal(result['notarized'],0)
assert(result['notarizedtxid']) assert_equal(result['notarizedhash'],'0000000000000000000000000000000000000000000000000000000000000000')
assert_equal(result['notarizedtxid'],'0000000000000000000000000000000000000000000000000000000000000000')
if __name__ == '__main__': if __name__ == '__main__':
DPoWTest().main() DPoWTest().main()

10
src/komodo_validation011.h

@ -54,6 +54,7 @@
}*/ }*/
#include <wallet/wallet.h> #include <wallet/wallet.h>
#include <chainparams.h>
#include <base58.h> #include <base58.h>
#define SATOSHIDEN ((uint64_t)100000000L) #define SATOSHIDEN ((uint64_t)100000000L)
@ -1004,11 +1005,14 @@ void komodo_notarized_update(int32_t nHeight,int32_t notarized_height,uint256 no
char fname[512];int32_t latestht = 0; char fname[512];int32_t latestht = 0;
//decode_hex(NOTARY_PUBKEY33,33,(char *)NOTARY_PUBKEY.c_str()); //decode_hex(NOTARY_PUBKEY33,33,(char *)NOTARY_PUBKEY.c_str());
pthread_mutex_init(&komodo_mutex,NULL); pthread_mutex_init(&komodo_mutex,NULL);
std::string suffix = Params().NetworkIDString() == "main" ? "" : "_" + Params().NetworkIDString();
std::string sep;
#ifdef _WIN32 #ifdef _WIN32
sprintf(fname,"%s\\notarizations",GetDefaultDataDir().string().c_str()); sep = "\\";
#else #else
sprintf(fname,"%s/notarizations",GetDefaultDataDir().string().c_str()); sep = "/";
#endif #endif
sprintf(fname,"%s%snotarizations%s",GetDefaultDataDir().string().c_str(), sep.c_str(), suffix.c_str());
LogPrintf("dpow: fname.(%s)\n",fname); LogPrintf("dpow: fname.(%s)\n",fname);
if ( (fp= fopen(fname,"rb+")) == 0 ) if ( (fp= fopen(fname,"rb+")) == 0 )
fp = fopen(fname,"wb+"); fp = fopen(fname,"wb+");
@ -1042,7 +1046,7 @@ void komodo_notarized_update(int32_t nHeight,int32_t notarized_height,uint256 no
} }
if ( notarized_height == 0 ) if ( notarized_height == 0 )
{ {
LogPrintf("dpow: notarized_height=0, aborting\n"); //LogPrintf("dpow: notarized_height=0, aborting\n");
return; return;
} }
if ( notarized_height >= nHeight ) if ( notarized_height >= nHeight )

Loading…
Cancel
Save