diff --git a/src/main.cpp b/src/main.cpp index 0f694c5b6..e76299a25 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1757,7 +1757,7 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa { if (pfMissingInputs) *pfMissingInputs = true; - //fprintf(stderr,"missing inputs\n"); + fprintf(stderr,"missing inputs in %s\n",tx.GetHash().ToString().c_str()); return state.DoS(0, error("AcceptToMemoryPool: tx inputs not found"),REJECT_INVALID, "bad-txns-inputs-missing"); } } @@ -3839,7 +3839,10 @@ bool static DisconnectTip(CValidationState &state, bool fBare = false) { //if ((i == (block.vtx.size() - 1)) && ((ASSETCHAINS_LWMAPOS && block.IsVerusPOSBlock()) || (ASSETCHAINS_STAKED != 0 && (komodo_isPoS((CBlock *)&block) != 0)))) if ((i == (block.vtx.size() - 1)) && (ASSETCHAINS_STAKED != 0 && (komodo_isPoS((CBlock *)&block) != 0))) { - EraseFromWallets(tx.GetHash()); + //EraseFromWallets(tx.GetHash()); +#ifdef ENABLE_WALLET + pwalletMain->EraseFromWallet(tx.GetHash()); +#endif } else { diff --git a/src/miner.cpp b/src/miner.cpp index 272ca98be..bb38e1c02 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -1569,7 +1569,7 @@ void static BitcoinMiner() } //else fprintf(stderr,"duplicate at j.%d\n",j); } else Mining_start = 0; } else Mining_start = 0; - if ( ASSETCHAINS_STAKED != 0 ) + if ( ASSETCHAINS_STAKED > 0 ) { int32_t percPoS,z; bool fNegative,fOverflow; HASHTarget_POW = komodo_PoWtarget(&percPoS,HASHTarget,Mining_height,ASSETCHAINS_STAKED); @@ -1858,8 +1858,10 @@ void static BitcoinMiner() } //fprintf(stderr,"nThreads.%d fGenerate.%d\n",(int32_t)nThreads,fGenerate); - if ( nThreads == 0 && ASSETCHAINS_STAKED ) + if ( ASSETCHAINS_STAKED > 0 && pwallet != NULL && nThreads == 0 ) nThreads = 1; + else + return; if ((nThreads == 0 || !fGenerate) && (VERUS_MINTBLOCKS == 0 || pwallet == NULL)) return; diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 06f87a79b..73293c669 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -5365,7 +5365,7 @@ int32_t komodo_staked(CMutableTransaction &txNew,uint32_t nBits,uint32_t *blockt } } //else fprintf(stderr,"utxo not eligible\n"); } - if ( numkp < 10000 && array != 0 ) + if ( numkp < 1000000 && array != 0 ) { free(array); array = 0; @@ -7283,7 +7283,7 @@ UniValue tokenfillask(const UniValue& params, bool fHelp) LOCK2(cs_main, pwalletMain->cs_wallet); tokenid = Parseuint256((char *)params[0].get_str().c_str()); asktxid = Parseuint256((char *)params[1].get_str().c_str()); - //fillunits = atol(params[2].get_str().c_str()); + //fillunits = atol(params[2].get_str().c_str()); fillunits = atoll(params[2].get_str().c_str()); // dimxy changed to prevent loss of significance if ( fillunits <= 0 ) {