Merge pull request #458 from TheBlueMatt/copyright
authorGavin Andresen <gavinandresen@gmail.com>
Thu, 11 Aug 2011 17:34:29 +0000 (10:34 -0700)
committerGavin Andresen <gavinandresen@gmail.com>
Thu, 11 Aug 2011 17:34:29 +0000 (10:34 -0700)
Unify copyright notices.

1  2 
src/db.cpp
src/key.h
src/main.cpp
src/net.cpp
src/net.h
src/script.h
src/serialize.h

diff --combined src/db.cpp
@@@ -1,4 -1,5 +1,5 @@@
  // Copyright (c) 2009-2010 Satoshi Nakamoto
+ // Copyright (c) 2011 The Bitcoin developers
  // Distributed under the MIT/X11 software license, see the accompanying
  // file license.txt or http://www.opensource.org/licenses/mit-license.php.
  
@@@ -610,7 -611,7 +611,7 @@@ bool CWalletDB::WriteAccount(const stri
  
  bool CWalletDB::WriteAccountingEntry(const CAccountingEntry& acentry)
  {
 -    return Write(make_tuple(string("acentry"), acentry.strAccount, ++nAccountingEntryNumber), acentry);
 +    return Write(boost::make_tuple(string("acentry"), acentry.strAccount, ++nAccountingEntryNumber), acentry);
  }
  
  int64 CWalletDB::GetAccountCreditDebit(const string& strAccount)
@@@ -638,7 -639,7 +639,7 @@@ void CWalletDB::ListAccountCreditDebit(
          // Read next record
          CDataStream ssKey;
          if (fFlags == DB_SET_RANGE)
 -            ssKey << make_tuple(string("acentry"), (fAllAccounts? string("") : strAccount), uint64(0));
 +            ssKey << boost::make_tuple(string("acentry"), (fAllAccounts? string("") : strAccount), uint64(0));
          CDataStream ssValue;
          int ret = ReadAtCursor(pcursor, ssKey, ssValue, fFlags);
          fFlags = DB_NEXT;
diff --combined src/key.h
+++ b/src/key.h
@@@ -1,20 -1,14 +1,21 @@@
  // Copyright (c) 2009-2010 Satoshi Nakamoto
+ // Copyright (c) 2011 The Bitcoin developers
  // Distributed under the MIT/X11 software license, see the accompanying
  // file license.txt or http://www.opensource.org/licenses/mit-license.php.
  #ifndef BITCOIN_KEY_H
  #define BITCOIN_KEY_H
  
 +#include <stdexcept>
 +#include <vector>
 +
  #include <openssl/ec.h>
  #include <openssl/ecdsa.h>
  #include <openssl/obj_mac.h>
  
 +#include "serialize.h"
 +#include "uint256.h"
 +#include "base58.h"
 +
  // secp160k1
  // const unsigned int PRIVATE_KEY_SIZE = 192;
  // const unsigned int PUBLIC_KEY_SIZE  = 41;
diff --combined src/main.cpp
@@@ -1,4 -1,5 +1,5 @@@
  // Copyright (c) 2009-2010 Satoshi Nakamoto
+ // Copyright (c) 2011 The Bitcoin developers
  // Distributed under the MIT/X11 software license, see the accompanying
  // file license.txt or http://www.opensource.org/licenses/mit-license.php.
  #include "headers.h"
@@@ -314,15 -315,6 +315,15 @@@ bool CTransaction::CheckTransaction() c
              return error("CTransaction::CheckTransaction() : txout total out of range");
      }
  
 +    // Check for duplicate inputs
 +    set<COutPoint> vInOutPoints;
 +    BOOST_FOREACH(const CTxIn& txin, vin)
 +    {
 +        if (vInOutPoints.count(txin.prevout))
 +            return false;
 +        vInOutPoints.insert(txin.prevout);
 +    }
 +
      if (IsCoinBase())
      {
          if (vin[0].scriptSig.size() < 2 || vin[0].scriptSig.size() > 100)
@@@ -1775,7 -1767,7 +1776,7 @@@ bool static AlreadyHave(CTxDB& txdb, co
  // The message start string is designed to be unlikely to occur in normal data.
  // The characters are rarely used upper ascii, not valid as UTF-8, and produce
  // a large 4-byte int at any alignment.
 -char pchMessageStart[4] = { 0xf9, 0xbe, 0xb4, 0xd9 };
 +unsigned char pchMessageStart[4] = { 0xf9, 0xbe, 0xb4, 0xd9 };
  
  
  bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
diff --combined src/net.cpp
@@@ -1,4 -1,5 +1,5 @@@
  // Copyright (c) 2009-2010 Satoshi Nakamoto
+ // Copyright (c) 2011 The Bitcoin developers
  // Distributed under the MIT/X11 software license, see the accompanying
  // file license.txt or http://www.opensource.org/licenses/mit-license.php.
  
@@@ -98,7 -99,7 +99,7 @@@ bool ConnectSocket(const CAddress& addr
      SOCKET hSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
      if (hSocket == INVALID_SOCKET)
          return false;
 -#ifdef BSD
 +#ifdef SO_NOSIGPIPE
      int set = 1;
      setsockopt(hSocket, SOL_SOCKET, SO_NOSIGPIPE, (void*)&set, sizeof(int));
  #endif
@@@ -1143,11 -1144,6 +1144,11 @@@ void MapPort(bool fMapPort
              printf("Error: ThreadMapPort(ThreadMapPort) failed\n");
      }
  }
 +#else
 +void MapPort(bool /* unused fMapPort */)
 +{
 +    // Intentionally left blank.
 +}
  #endif
  
  
@@@ -1584,7 -1580,7 +1585,7 @@@ bool BindListenPort(string& strError
          return false;
      }
  
 -#ifdef BSD
 +#ifdef SO_NOSIGPIPE
      // Different way of disabling SIGPIPE on BSD
      setsockopt(hListenSocket, SOL_SOCKET, SO_NOSIGPIPE, (void*)&nOne, sizeof(int));
  #endif
diff --combined src/net.h
+++ b/src/net.h
@@@ -1,4 -1,5 +1,5 @@@
  // Copyright (c) 2009-2010 Satoshi Nakamoto
+ // Copyright (c) 2011 The Bitcoin developers
  // Distributed under the MIT/X11 software license, see the accompanying
  // file license.txt or http://www.opensource.org/licenses/mit-license.php.
  #ifndef BITCOIN_NET_H
@@@ -6,7 -7,6 +7,7 @@@
  
  #include <deque>
  #include <boost/array.hpp>
 +#include <boost/foreach.hpp>
  #include <openssl/rand.h>
  
  #ifndef __WXMSW__
@@@ -67,7 -67,7 +68,7 @@@ bool StopNode()
  //  (4) size
  //  (4) checksum
  
 -extern char pchMessageStart[4];
 +extern unsigned char pchMessageStart[4];
  
  class CMessageHeader
  {
diff --combined src/script.h
@@@ -1,4 -1,5 +1,5 @@@
  // Copyright (c) 2009-2010 Satoshi Nakamoto
+ // Copyright (c) 2011 The Bitcoin developers
  // Distributed under the MIT/X11 software license, see the accompanying
  // file license.txt or http://www.opensource.org/licenses/mit-license.php.
  #ifndef H_BITCOIN_SCRIPT
@@@ -10,8 -11,6 +11,8 @@@
  #include <string>
  #include <vector>
  
 +#include <boost/foreach.hpp>
 +
  class CTransaction;
  
  enum
@@@ -691,7 -690,6 +692,7 @@@ public
  
  
  
 +bool EvalScript(std::vector<std::vector<unsigned char> >& stack, const CScript& script, const CTransaction& txTo, unsigned int nIn, int nHashType);
  
  bool IsStandard(const CScript& scriptPubKey);
  bool IsMine(const CKeyStore& keystore, const CScript& scriptPubKey);
diff --combined src/serialize.h
@@@ -1,4 -1,5 +1,5 @@@
  // Copyright (c) 2009-2010 Satoshi Nakamoto
+ // Copyright (c) 2011 The Bitcoin developers
  // Distributed under the MIT/X11 software license, see the accompanying
  // file license.txt or http://www.opensource.org/licenses/mit-license.php.
  #ifndef BITCOIN_SERIALIZE_H
@@@ -34,7 -35,6 +35,7 @@@ typedef unsigned long long  uint64
  // Note that VirtualLock does not provide this as a guarantee on Windows,
  // but, in practice, memory that has been VirtualLock'd almost never gets written to
  // the pagefile except in rare circumstances where memory is extremely low.
 +#include <windows.h>
  #define mlock(p, n) VirtualLock((p), (n));
  #define munlock(p, n) VirtualUnlock((p), (n));
  #else