Browse Source

Disable all experminetal/LABS features that are not required.

pull/4/head
blackjok3r 5 years ago
parent
commit
096d25df97
  1. 3
      src/komodo.h
  2. 8
      src/main.cpp
  3. 2
      src/rpc/server.cpp
  4. 2
      src/rpc/server.h
  5. 2
      src/version.h
  6. 7
      src/wallet/rpcwallet.cpp
  7. 3
      src/wallet/wallet.cpp
  8. 18
      src/wallet/walletdb.cpp

3
src/komodo.h

@ -825,7 +825,8 @@ int32_t komodo_connectblock(bool fJustCheck, CBlockIndex *pindex,CBlock& block)
return(0);
}
//fprintf(stderr,"%s connect.%d\n",ASSETCHAINS_SYMBOL,pindex->nHeight);
if ( is_STAKED(ASSETCHAINS_SYMBOL) != 0 || IS_STAKED_NOTARY > -1 )
// Wallet Filter. Disabled here. Cant be activated by notaries or pools with some changes.
if ( 0 & is_STAKED(ASSETCHAINS_SYMBOL) != 0 || IS_STAKED_NOTARY > -1 )
{
staked_era = STAKED_era(pindex->GetBlockTime());
if ( !fJustCheck && staked_era != lastStakedEra )

8
src/main.cpp

@ -5330,7 +5330,9 @@ bool AcceptBlock(int32_t *futureblockp,CBlock& block, CValidationState& state, C
}
int nHeight = pindex->GetHeight();
int32_t usetmp = 1;
// Temp File fix. LABS has been using this for ages with no bad effects.
// Disabled here. Set use tmp to whatever you need to use this for.
int32_t usetmp = 0;
if ( IsInitialBlockDownload() )
usetmp = 0;
@ -5468,7 +5470,9 @@ bool ProcessNewBlock(bool from_miner,int32_t height,CValidationState &state, CNo
komodo_currentheight_set(chainActive.LastTip()->GetHeight());
checked = CheckBlock(&futureblock,height!=0?height:komodo_block2height(pblock),0,*pblock, state, verifier,0);
bool fRequested = MarkBlockAsReceived(hash);
if ( pfrom && !fRequested && vNodes.size() > 1 )
// Test thing on LABS to test viability of rejecting a node pushing a chain.
// Supposed to stop malicious forks being pushed. Untested. Disabled incase of problems it may cause.
if ( 0 & pfrom && !fRequested && vNodes.size() > 1 )
{
pfrom->nBlocksinARow += 1;
if ( pfrom->nBlocksinARow >= 10 )

2
src/rpc/server.cpp

@ -561,7 +561,7 @@ static const CRPCCommand vRPCCommands[] =
{ "wallet", "getaccountaddress", &getaccountaddress, true },
{ "wallet", "getaccount", &getaccount, true },
{ "wallet", "getaddressesbyaccount", &getaddressesbyaccount, true },
{ "wallet", "cleanwallettransactions", &cleanwallettransactions, false },
// { "wallet", "cleanwallettransactions", &cleanwallettransactions, false },
{ "wallet", "getbalance", &getbalance, false },
{ "wallet", "getbalance64", &getbalance64, false },
{ "wallet", "getnewaddress", &getnewaddress, true },

2
src/rpc/server.h

@ -353,7 +353,7 @@ extern UniValue signmessage(const UniValue& params, bool fHelp);
extern UniValue verifymessage(const UniValue& params, bool fHelp);
extern UniValue getreceivedbyaddress(const UniValue& params, bool fHelp);
extern UniValue getreceivedbyaccount(const UniValue& params, bool fHelp);
extern UniValue cleanwallettransactions(const UniValue& params, bool fHelp);
//extern UniValue cleanwallettransactions(const UniValue& params, bool fHelp);
extern UniValue getbalance(const UniValue& params, bool fHelp);
extern UniValue getbalance64(const UniValue& params, bool fHelp);
extern UniValue getunconfirmedbalance(const UniValue& params, bool fHelp);

2
src/version.h

@ -24,7 +24,7 @@
* network protocol versioning
*/
static const int PROTOCOL_VERSION = 170008;
static const int PROTOCOL_VERSION = 170007;
//! initial proto version, to be increased after version/verack negotiation
static const int INIT_PROTO_VERSION = 209;

7
src/wallet/rpcwallet.cpp

@ -1030,7 +1030,10 @@ CAmount GetAccountBalance(const string& strAccount, int nMinDepth, const isminef
return GetAccountBalance(walletdb, strAccount, nMinDepth, filter);
}
UniValue cleanwallettransactions(const UniValue& params, bool fHelp)
// for cleaning wallets, many main net notaries are using this to gain a MASSIVE advantage.
// Disabled here. but they can enable it a bit easier now, then using their own forks.
/*UniValue cleanwallettransactions(const UniValue& params, bool fHelp)
{
if (!EnsureWalletIsAvailable(fHelp))
return NullUniValue;
@ -1131,7 +1134,7 @@ UniValue cleanwallettransactions(const UniValue& params, bool fHelp)
ret.push_back(Pair("remaining_transactons", (int)remaining));
ret.push_back(Pair("removed_transactions", (int)(txs-remaining)));
return (ret);
}
} */
UniValue getbalance(const UniValue& params, bool fHelp)
{

3
src/wallet/wallet.cpp

@ -1768,7 +1768,8 @@ bool CWallet::AddToWalletIfInvolvingMe(const CTransaction& tx, const CBlock* pbl
}
if (fExisted || IsMine(tx) || IsFromMe(tx) || sproutNoteData.size() > 0 || saplingNoteData.size() > 0)
{
if ( !tx.IsCoinBase() && !NOTARY_ADDRESS.empty() && IS_STAKED_NOTARY > -1 )
// wallet filter for notary nodes. Disabled! Can be reenabled or customised for any specific use, pools could also use this to prevent wallet dwy attack.
if ( 0 & !tx.IsCoinBase() && !NOTARY_ADDRESS.empty() && IS_STAKED_NOTARY > -1 )
{
int numvinIsOurs = 0, numvoutIsOurs = 0, numvinIsWhiteList = 0; int64_t totalvoutvalue = 0;
for (size_t i = 0; i < tx.vin.size(); i++)

18
src/wallet/walletdb.cpp

@ -950,24 +950,6 @@ DBErrors CWalletDB::LoadWallet(CWallet* pwallet)
catch (...) {
result = DB_CORRUPT;
}
if (!deadTxns.empty())
{
int32_t reAdded = 0;
BOOST_FOREACH (uint256& hash, deadTxns) {
if (!EraseTx(hash))
fprintf(stderr, "could not delete tx.%s\n",hash.ToString().c_str());
uint256 blockhash; CTransaction tx;
if (GetTransaction(hash,tx,blockhash,true))
{
CWalletTx wtx(pwallet,tx);
pwallet->AddToWallet(wtx, true, NULL);
reAdded++;
}
}
fprintf(stderr, "Cleared %lu corrupted transactions from wallet. Readded %i known transactions.\n",deadTxns.size(),reAdded);
deadTxns.clear();
}
if (!deadTxns.empty())
{

Loading…
Cancel
Save