diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2011-08-11 10:17:21 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2011-08-11 10:17:21 +0200 |
commit | 0a76546ae973241259aa5019e0d27758f86ef891 (patch) | |
tree | 2b2fd48e1a1c18cf4f2d8fb6ad8ccec812779532 /src/main.cpp | |
parent | b0849613bf02b61774b23804c8feed54aa88474a (diff) | |
parent | c648b589bec6494551d300b335af88d6b194cf82 (diff) |
Merge branch 'master' of https://github.com/bitcoin/bitcoin
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp index cc40fe9749..99600771c7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -314,6 +314,15 @@ bool CTransaction::CheckTransaction() const 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) @@ -1766,7 +1775,7 @@ bool static AlreadyHave(CTxDB& txdb, const CInv& inv) // 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) |