aboutsummaryrefslogtreecommitdiff
path: root/src/core.cpp
diff options
context:
space:
mode:
authorGavin Andresen <[email protected]>2014-06-30 08:35:12 -0400
committerGavin Andresen <[email protected]>2014-06-30 08:35:12 -0400
commit8ceb28afc3799c765d1fce242d9c9472d5f4024c (patch)
tree39e751cf37191b98e399380e2517873ac1bd62bf /src/core.cpp
parentMerge pull request #4420 from sipa/skiplist (diff)
parentFormatting, spelling, comment fixes. (diff)
downloaddiscoin-8ceb28afc3799c765d1fce242d9c9472d5f4024c.tar.xz
discoin-8ceb28afc3799c765d1fce242d9c9472d5f4024c.zip
Merge pull request #3883 from dgenr8/first_double_spend
Relay and alert user to double spends
Diffstat (limited to 'src/core.cpp')
-rw-r--r--src/core.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/core.cpp b/src/core.cpp
index 6c5ee1c0f..ca2862452 100644
--- a/src/core.cpp
+++ b/src/core.cpp
@@ -119,6 +119,22 @@ CTransaction& CTransaction::operator=(const CTransaction &tx) {
return *this;
}
+bool CTransaction::IsEquivalentTo(const CTransaction& tx) const
+{
+ if (nVersion != tx.nVersion ||
+ nLockTime != tx.nLockTime ||
+ vin.size() != tx.vin.size() ||
+ vout != tx.vout)
+ return false;
+ for (unsigned int i = 0; i < vin.size(); i++)
+ {
+ if (vin[i].nSequence != tx.vin[i].nSequence ||
+ vin[i].prevout != tx.vin[i].prevout)
+ return false;
+ }
+ return true;
+}
+
int64_t CTransaction::GetValueOut() const
{
int64_t nValueOut = 0;