aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2015-07-06 19:11:02 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2015-07-06 19:11:14 +0200
commit086cb336cd8ac0b2a7ad9ff0544c014569c7db38 (patch)
treed46dd38cf56d4330650832c62998b6d47d6149de
parent9546a977d354b2ec6cd8455538e68fe4ba343a44 (diff)
parent5a7304b69dcdb3323fbade3a150be94b42d8ab43 (diff)
Merge pull request #6365
5a7304b Move recently introduced CTransAction::IsEquivalentTo to CWalletTx (Wladimir J. van der Laan)
-rw-r--r--src/primitives/transaction.cpp9
-rw-r--r--src/primitives/transaction.h3
-rw-r--r--src/wallet/wallet.cpp9
-rw-r--r--src/wallet/wallet.h3
4 files changed, 12 insertions, 12 deletions
diff --git a/src/primitives/transaction.cpp b/src/primitives/transaction.cpp
index d864a9b6d3..606dbea798 100644
--- a/src/primitives/transaction.cpp
+++ b/src/primitives/transaction.cpp
@@ -87,15 +87,6 @@ CTransaction& CTransaction::operator=(const CTransaction &tx) {
return *this;
}
-bool CTransaction::IsEquivalentTo(const CTransaction& tx) const
-{
- CMutableTransaction tx1 = *this;
- CMutableTransaction tx2 = tx;
- for (unsigned int i = 0; i < tx1.vin.size(); i++) tx1.vin[i].scriptSig = CScript();
- for (unsigned int i = 0; i < tx2.vin.size(); i++) tx2.vin[i].scriptSig = CScript();
- return CTransaction(tx1) == CTransaction(tx2);
-}
-
CAmount CTransaction::GetValueOut() const
{
CAmount nValueOut = 0;
diff --git a/src/primitives/transaction.h b/src/primitives/transaction.h
index 0c9ebb7b88..6cfd93a9a1 100644
--- a/src/primitives/transaction.h
+++ b/src/primitives/transaction.h
@@ -222,9 +222,6 @@ public:
return hash;
}
- // True if only scriptSigs are different
- bool IsEquivalentTo(const CTransaction& tx) const;
-
// Return sum of txouts.
CAmount GetValueOut() const;
// GetValueIn() is a method on CCoinsViewCache, because
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp
index bb96255361..7b3cd9803b 100644
--- a/src/wallet/wallet.cpp
+++ b/src/wallet/wallet.cpp
@@ -1332,6 +1332,15 @@ bool CWalletTx::IsTrusted() const
return true;
}
+bool CWalletTx::IsEquivalentTo(const CWalletTx& tx) const
+{
+ CMutableTransaction tx1 = *this;
+ CMutableTransaction tx2 = tx;
+ for (unsigned int i = 0; i < tx1.vin.size(); i++) tx1.vin[i].scriptSig = CScript();
+ for (unsigned int i = 0; i < tx2.vin.size(); i++) tx2.vin[i].scriptSig = CScript();
+ return CTransaction(tx1) == CTransaction(tx2);
+}
+
std::vector<uint256> CWallet::ResendWalletTransactionsBefore(int64_t nTime)
{
std::vector<uint256> result;
diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h
index f36c98e9fc..003266ba19 100644
--- a/src/wallet/wallet.h
+++ b/src/wallet/wallet.h
@@ -378,6 +378,9 @@ public:
return (GetDebit(filter) > 0);
}
+ // True if only scriptSigs are different
+ bool IsEquivalentTo(const CWalletTx& tx) const;
+
bool IsTrusted() const;
bool WriteToDisk(CWalletDB *pwalletdb);