Skip to content

Commit

Permalink
refactor: drop functions from struct which supposed to be simple as p…
Browse files Browse the repository at this point in the history
…ossible
  • Loading branch information
panleone committed Mar 24, 2024
1 parent b2bb097 commit 9d429f4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
12 changes: 1 addition & 11 deletions src/primitives/transaction.h
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ struct CMutableTransaction
SER_READ(obj, obj.nVersion = (int16_t) (n32bitVersion & 0xffff));
SER_READ(obj, obj.nType = (uint16_t) ((n32bitVersion >> 16) & 0xffff));
READWRITE(obj.vin, obj.vout, obj.nLockTime);
if (obj.HasExtraPayloadField()) {
if (obj.nVersion >= 3 && obj.nType != TRANSACTION_NORMAL) {
READWRITE(obj.vExtraPayload);
}
}
Expand All @@ -314,16 +314,6 @@ struct CMutableTransaction
uint256 GetHash() const;

std::string ToString() const;

bool IsSpecialTxVersion() const
{
return nVersion >= 3;
}

bool HasExtraPayloadField() const
{
return IsSpecialTxVersion() && nType != TRANSACTION_NORMAL;
}
};

typedef std::shared_ptr<const CTransaction> CTransactionRef;
Expand Down
2 changes: 1 addition & 1 deletion src/script/interpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1476,7 +1476,7 @@ class CTransactionSignatureSerializer
SerializeOutput(s, nOutput);
// Serialize nLockTime
::Serialize(s, txTo.nLockTime);
if (txTo.HasExtraPayloadField())
if (txTo.nVersion >= 3 && txTo.nType != TRANSACTION_NORMAL)
::Serialize(s, txTo.vExtraPayload);
}
};
Expand Down

0 comments on commit 9d429f4

Please sign in to comment.