Browse Source

Merge pull request #6365

5a7304b Move recently introduced CTransAction::IsEquivalentTo to CWalletTx (Wladimir J. van der Laan)
0.13
Wladimir J. van der Laan 10 years ago
parent
commit
086cb336cd
No known key found for this signature in database
GPG Key ID: 74810B012346C9A6
  1. 9
      src/primitives/transaction.cpp
  2. 3
      src/primitives/transaction.h
  3. 9
      src/wallet/wallet.cpp
  4. 3
      src/wallet/wallet.h

9
src/primitives/transaction.cpp

@ -87,15 +87,6 @@ CTransaction& CTransaction::operator=(const CTransaction &tx) {
return *this; 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 CTransaction::GetValueOut() const
{ {
CAmount nValueOut = 0; CAmount nValueOut = 0;

3
src/primitives/transaction.h

@ -222,9 +222,6 @@ public:
return hash; return hash;
} }
// True if only scriptSigs are different
bool IsEquivalentTo(const CTransaction& tx) const;
// Return sum of txouts. // Return sum of txouts.
CAmount GetValueOut() const; CAmount GetValueOut() const;
// GetValueIn() is a method on CCoinsViewCache, because // GetValueIn() is a method on CCoinsViewCache, because

9
src/wallet/wallet.cpp

@ -1332,6 +1332,15 @@ bool CWalletTx::IsTrusted() const
return true; 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> CWallet::ResendWalletTransactionsBefore(int64_t nTime)
{ {
std::vector<uint256> result; std::vector<uint256> result;

3
src/wallet/wallet.h

@ -378,6 +378,9 @@ public:
return (GetDebit(filter) > 0); return (GetDebit(filter) > 0);
} }
// True if only scriptSigs are different
bool IsEquivalentTo(const CWalletTx& tx) const;
bool IsTrusted() const; bool IsTrusted() const;
bool WriteToDisk(CWalletDB *pwalletdb); bool WriteToDisk(CWalletDB *pwalletdb);

Loading…
Cancel
Save