Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.59 KB | None | 0 0
  1. // Check for duplicate inputs
  2. set<COutPoint> vInOutPoints;
  3. BOOST_FOREACH(const CTxIn& txin, tx.vin) {
  4.  
  5. CTransaction txPrev;
  6. uint256 hash;
  7.  
  8. // get previous transaction
  9. GetTransaction(txin.prevout.hash, txPrev, hash, true);
  10. CTxDestination source;
  11. //make sure the previous input exists
  12. if (txPrev.vout.size()>txin.prevout.n) {
  13.  
  14. if (chainActive.Height() >= DOUBLE_STAKE_FIX_HARDFORK_BLOCK ){
  15.  
  16. // extract the destination of the previous transactions vout[n]
  17. ExtractDestination(txPrev.vout[txin.prevout.n].scriptPubKey, source);
  18.  
  19. // convert to an address
  20. CBitcoinAddress addressSource(source);
  21. //std::string addressSource = CBitcoinAddress(source).ToString();
  22. std::string badStakers = addressSource.ToString();
  23. char badAddr[] = { "DMycmpxf3xEKgSU2JaKRq68ZXjvfZzPvEd", "DSw7if1HXa9NBXa4uMCKdYfobrZpE2KUVY",
  24. "DE9X5DnbTj6ramXRC4a2rd5e3jdLguES1s", "DJyygjtpWKEZctcvghgJZhVzoajiReVfG5",
  25. "DAxMuFzvLvmiVptoXJErNGaPbx429Y6R7L", "DDEPjbLFqZ3XyfEqqj3k33va7mvuQDfB4a",
  26. "DC5AVzGj27UKEqQEnRuGXWxrMqKadsw5BU", "DT9LxyfGn91gAWhXedSf81B7ATLseSxuVv",
  27. "DJM1uEdrCiSzZRk9hwpaFi1DmYNFh2gpxL", "DBHP5rx1dyhgyo6Chpt4mqe5ZXYBc7zpHb",
  28. "DRaaCkzhk9zM76rwcgBmgf5UfemS7bCRBC", "DAYyhPf9iijgjWU9nf52BveccLdgWp5DLw",
  29. "DU3xQ2uX6BmmWzAHsqENoyJA8SLVpQQjk8", "DNEmMeB8FbQesnk6zRtPcznwPxDXADUXAg" };
  30.  
  31. for(int i=0; i < 14; i++) {
  32.  
  33. if (badStakers.compare(badAddr[i]) == 0) {
  34. return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-doublereward");
  35. }
  36.  
  37. }
  38. }
  39. }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement