mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
Expose transaction data via BaseSignatureChecker
This commit is contained in:
parent
007912eea4
commit
61b5152d44
2 changed files with 87 additions and 0 deletions
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
#include <script/interpreter.h>
|
||||
|
||||
#include <consensus/consensus.h>
|
||||
#include <crypto/ripemd160.h>
|
||||
#include <crypto/sha1.h>
|
||||
#include <crypto/sha256.h>
|
||||
|
|
@ -2398,6 +2399,49 @@ bool GenericTransactionSignatureChecker<T>::CheckSequence(const CScriptNum& nSeq
|
|||
return true;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
uint32_t GenericTransactionSignatureChecker<T>::GetLockTime() const
|
||||
{
|
||||
return txTo->nLockTime;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
int32_t GenericTransactionSignatureChecker<T>::GetTxVersion() const
|
||||
{
|
||||
return txTo->nVersion;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
const std::vector<CTxIn>* GenericTransactionSignatureChecker<T>::GetTxvIn() const
|
||||
{
|
||||
return &(txTo->vin);
|
||||
}
|
||||
|
||||
template <class T>
|
||||
const std::vector<CTxOut>* GenericTransactionSignatureChecker<T>::GetTxvOut() const
|
||||
{
|
||||
return &(txTo->vout);
|
||||
}
|
||||
|
||||
template <class T>
|
||||
uint64_t GenericTransactionSignatureChecker<T>::GetTxWeight() const
|
||||
{
|
||||
// line copied from GetTransactionWeight() in src/consensus/validation.h
|
||||
return ::GetSerializeSize(*txTo, PROTOCOL_VERSION | SERIALIZE_TRANSACTION_NO_WITNESS) * (WITNESS_SCALE_FACTOR - 1) + ::GetSerializeSize(*txTo, PROTOCOL_VERSION);
|
||||
}
|
||||
|
||||
template <class T>
|
||||
const PrecomputedTransactionData* GenericTransactionSignatureChecker<T>::GetPrecomputedTransactionData() const
|
||||
{
|
||||
return txdata;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
uint32_t GenericTransactionSignatureChecker<T>::GetnIn() const
|
||||
{
|
||||
return nIn;
|
||||
}
|
||||
|
||||
// explicit instantiation
|
||||
template class GenericTransactionSignatureChecker<CTransaction>;
|
||||
template class GenericTransactionSignatureChecker<CMutableTransaction>;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue