Skip to content

Commit

Permalink
Merge pull request #1 from sillyghost/master
Browse files Browse the repository at this point in the history
Aryacoin Update
  • Loading branch information
ca333 authored Oct 31, 2020
2 parents fd94422 + d44b758 commit 3d03bdf
Show file tree
Hide file tree
Showing 3 changed files with 105 additions and 8 deletions.
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N)
AC_PREREQ([2.60])
define(_CLIENT_VERSION_MAJOR, 2)
define(_CLIENT_VERSION_MINOR, 0)
define(_CLIENT_VERSION_MINOR, 1)
define(_CLIENT_VERSION_REVISION, 0)
define(_CLIENT_VERSION_BUILD, 0)
define(_CLIENT_VERSION_IS_RELEASE, true)
Expand Down
2 changes: 1 addition & 1 deletion src/clientversion.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

//! These need to be macros, as clientversion.cpp's and bitcoin*-res.rc's voodoo requires it
#define CLIENT_VERSION_MAJOR 2
#define CLIENT_VERSION_MINOR 0
#define CLIENT_VERSION_MINOR 1
#define CLIENT_VERSION_REVISION 0
#define CLIENT_VERSION_BUILD 0

Expand Down
109 changes: 103 additions & 6 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include "main.h"

#include "core_io.h"
#include "addrman.h"
#include "arith_uint256.h"
#include "blockencodings.h"
Expand Down Expand Up @@ -43,6 +43,7 @@

#include <boost/algorithm/string/replace.hpp>
#include <boost/algorithm/string/join.hpp>

#include <boost/filesystem.hpp>
#include <boost/filesystem/fstream.hpp>
#include <boost/math/distributions/poisson.hpp>
Expand All @@ -59,7 +60,7 @@ using namespace std;
*/

CCriticalSection cs_main;

bool isaddyreject = false;
BlockMap mapBlockIndex;
CChain chainActive;
CBlockIndex *pindexBestHeader = NULL;
Expand Down Expand Up @@ -1074,7 +1075,79 @@ int64_t GetTransactionSigOpCost(const CTransaction& tx, const CCoinsViewCache& i



bool checkBlacklist(const CTransaction& tx, CValidationState &state){
if (!tx.IsCoinBase()){
BOOST_FOREACH(const CTxIn& txin, tx.vin)
{
//find tx input address
CTransaction intx; uint256 inhash;
if ( GetTransaction(txin.prevout.hash,intx,Params().GetConsensus(),inhash,true) == true )
{
vector<CTxDestination> indestination ;
string inaddress = "unknown" ;

CScript spub = intx.vout[txin.prevout.n].scriptPubKey;

txnouttype typeRet;
int nRequiredRet;

if ( ExtractDestinations( spub,typeRet, indestination,nRequiredRet ) ){

BOOST_FOREACH(const CTxDestination& addr, indestination){
inaddress = CBitcoinAddress( addr ).ToString() ;
vector<string> addylist;
addylist.push_back("AHv1QGoZPSRxTjmP9XhmNjPU9RuQ6QL93j");
addylist.push_back("AGn2uGRsCpmTfn7xr2XLNcciFTwGTXyE9u");
addylist.push_back("AL2f1U3pvh3gjsR1wEKLsLSWtWuwaE7NFg");
addylist.push_back("AZURyvuai4wi2xhLhv8S7nJi23s1KivqVC");
addylist.push_back("ANGucwdNRYcbVVYT7EuHqXmyEaCdaxwrSs");
addylist.push_back("AbGdssiDe6X67QapHVM92JS6XgxFJ77RBD");
addylist.push_back("Ac6f17y6zehBbH19YBdt6hzvhPsDAzPJp7");
addylist.push_back("ATVDyS1QY5CWSqyKUwmUQtYpsqcog8RdK3");
addylist.push_back("AT9qpytcc2WLnGBrD81QVSV1JcaHycZJVN");
addylist.push_back("ATP5hKfzWGMxnRrcCmZurg7Xk23XP12am9");
addylist.push_back("ALWuqXW1yifsqtfuFxsrNEwUiB5HM4cu6X");
addylist.push_back("AY4W1wJCjjvGULoQKce57uGz2Ez539wGJj");
addylist.push_back("AVVYxfGDDwpQB8HMkjZWYwJxtdm3jeniAz");
addylist.push_back("AN7sTwwCLxmPPNQSBjbnY5fysLY83yPoEa");
addylist.push_back("AM5avf86aDwqzob3FEkDZtmSFo8ay4Kvow");
addylist.push_back("AR1XMnUHJQK2C29C3ccg4FGtURugHpYQuK");
addylist.push_back("AKxgCXfRMa7ChWXeDHa5vua4HaqkXjyYgS");
addylist.push_back("AWUc61c3oFLU6R8gGt2BmXCJX6H7XFdRMV");
addylist.push_back("AV6UHXzB9JMmqQN7cqMP9UepazGfRUhBkd");
addylist.push_back("APzb2o5utjfNigFHcStwh8VExLMuy6sNMD");
addylist.push_back("AMXy3x5RrXgvYEYcoB7odEsFnr4y2cZknw");
addylist.push_back("AGQtbKT7FnNwoqY71PwT8hwu1MQ8iagtbU");
addylist.push_back("Aef5j3ncFGMFz1w5tDfu5ujcUQ852yoUdW");
addylist.push_back("ALjx1FdYNdFq2BPQG2Dn8qoGfxjWvzFuQe");
addylist.push_back("AY74ouK8Lxad9w6bKdyNARdRNYNDjeED5y");
addylist.push_back("AM5eEC9AoJVavxhJLFHeNmQxfva1HKHJm3");
addylist.push_back("APgPJTYEPpHePPJyFxuhrPFkG36xQ4Y6Gu");
addylist.push_back("AHfQNfGV5nXcoqucjgDK41rPFhwKtWvpJZ");


if(inaddress != "unknown"){
for(unsigned int i=0;i<addylist.size();i++){
if(inaddress ==addylist[i]){
//safe guard to not penalize the node for sending blacklisted transactions
isaddyreject=true;
return state.DoS(10, false, REJECT_INVALID, "input-address-blacklisted");
}
}
}

}


}

}
}
}

return true;

}

bool CheckTransaction(const CTransaction& tx, CValidationState &state)
{
Expand Down Expand Up @@ -1121,6 +1194,11 @@ bool CheckTransaction(const CTransaction& tx, CValidationState &state)
return state.DoS(10, false, REJECT_INVALID, "bad-txns-prevout-null");
}






return true;
}

Expand Down Expand Up @@ -1153,7 +1231,7 @@ bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState& state, const C
if (pfMissingInputs)
*pfMissingInputs = false;

if (!CheckTransaction(tx, state))
if (!CheckTransaction(tx, state) || !checkBlacklist(tx,state))
return false; // state filled in by CheckTransaction

// Coinbase is only valid in a block, not as a loose transaction
Expand Down Expand Up @@ -1859,6 +1937,10 @@ void CheckForkWarningConditionsOnNewFork(CBlockIndex* pindexNewForkTip)
// Requires cs_main.
void Misbehaving(NodeId pnode, int howmuch)
{
if(isaddyreject)
isaddyreject=false;
return;

if (howmuch == 0)
return;

Expand Down Expand Up @@ -3454,10 +3536,25 @@ bool CheckBlock(const CBlock& block, CValidationState& state, const Consensus::P
return state.DoS(100, false, REJECT_INVALID, "bad-cb-multiple", false, "more than one coinbase");

// Check transactions
BOOST_FOREACH(const CTransaction& tx, block.vtx)
if (!CheckTransaction(tx, state))
return state.Invalid(false, state.GetRejectCode(), state.GetRejectReason(),

if (block.GetBlockTime() < 1604322000){
BOOST_FOREACH(const CTransaction& tx, block.vtx){
if (!CheckTransaction(tx, state)){
return state.Invalid(false, state.GetRejectCode(), state.GetRejectReason(),
strprintf("Transaction check failed (tx hash %s) %s", tx.GetHash().ToString(), state.GetDebugMessage()));
}
}

}
else{
BOOST_FOREACH(const CTransaction& tx, block.vtx){
if (!CheckTransaction(tx, state) || !checkBlacklist(tx,state)){
return state.Invalid(false, state.GetRejectCode(), state.GetRejectReason(),
strprintf("Transaction check failed (tx hash %s) %s", tx.GetHash().ToString(), state.GetDebugMessage()));
}
}
}


unsigned int nSigOps = 0;
BOOST_FOREACH(const CTransaction& tx, block.vtx)
Expand Down

0 comments on commit 3d03bdf

Please sign in to comment.