mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-13 12:33:42 +02:00
Segwit: Rename CTransaction::GetWitnessHash() -> CTransaction::GetHashWithWitness()
This commit is contained in:
parent
6053519cea
commit
b7704f1717
8 changed files with 9 additions and 9 deletions
|
|
@ -25,7 +25,7 @@ CBlockHeaderAndShortTxIDs::CBlockHeaderAndShortTxIDs(const CBlock& block, bool f
|
|||
prefilledtxn[0] = {0, block.vtx[0]};
|
||||
for (size_t i = 1; i < block.vtx.size(); i++) {
|
||||
const CTransaction& tx = *block.vtx[i];
|
||||
shorttxids[i - 1] = GetShortID(fUseWTXID ? tx.GetWitnessHash() : tx.GetHash());
|
||||
shorttxids[i - 1] = GetShortID(fUseWTXID ? tx.GetHashWithWitness() : tx.GetHash());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -150,7 +150,7 @@ ReadStatus PartiallyDownloadedBlock::InitData(const CBlockHeaderAndShortTxIDs& c
|
|||
// Note that we dont want duplication between extra_txn and mempool to
|
||||
// trigger this case, so we compare witness hashes first
|
||||
if (txn_available[idit->second] &&
|
||||
txn_available[idit->second]->GetWitnessHash() != extra_txn[i].second->GetWitnessHash()) {
|
||||
txn_available[idit->second]->GetHashWithWitness() != extra_txn[i].second->GetHashWithWitness()) {
|
||||
txn_available[idit->second].reset();
|
||||
mempool_count--;
|
||||
extra_count--;
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ void ScriptPubKeyToUniv(const CScript& scriptPubKey,
|
|||
void TxToUniv(const CTransaction& tx, const uint256& hashBlock, UniValue& entry)
|
||||
{
|
||||
entry.pushKV("txid", tx.GetHash().GetHex());
|
||||
entry.pushKV("hash", tx.GetWitnessHash().GetHex());
|
||||
entry.pushKV("hash", tx.GetHashWithWitness().GetHex());
|
||||
entry.pushKV("version", tx.nVersion);
|
||||
entry.pushKV("locktime", (int64_t)tx.nLockTime);
|
||||
|
||||
|
|
|
|||
|
|
@ -599,7 +599,7 @@ void AddToCompactExtraTransactions(const CTransactionRef& tx)
|
|||
return;
|
||||
if (!vExtraTxnForCompact.size())
|
||||
vExtraTxnForCompact.resize(max_extra_txn);
|
||||
vExtraTxnForCompact[vExtraTxnForCompactIt] = std::make_pair(tx->GetWitnessHash(), tx);
|
||||
vExtraTxnForCompact[vExtraTxnForCompactIt] = std::make_pair(tx->GetHashWithWitness(), tx);
|
||||
vExtraTxnForCompactIt = (vExtraTxnForCompactIt + 1) % max_extra_txn;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ uint256 CTransaction::ComputeHash() const
|
|||
return SerializeHash(*this, SER_GETHASH, SERIALIZE_TRANSACTION_NO_WITNESS);
|
||||
}
|
||||
|
||||
uint256 CTransaction::GetWitnessHash() const
|
||||
uint256 CTransaction::GetHashWithWitness() const
|
||||
{
|
||||
if (!HasWitness()) {
|
||||
return GetHash();
|
||||
|
|
|
|||
|
|
@ -702,7 +702,7 @@ public:
|
|||
}
|
||||
|
||||
// Compute a hash that includes both transaction and witness data
|
||||
uint256 GetWitnessHash() const;
|
||||
uint256 GetHashWithWitness() const;
|
||||
|
||||
// Check if explicit TX fees overflow or are negative
|
||||
bool HasValidFee() const;
|
||||
|
|
|
|||
|
|
@ -638,7 +638,7 @@ UniValue getblocktemplate(const JSONRPCRequest& request)
|
|||
|
||||
entry.push_back(Pair("data", EncodeHexTx(tx)));
|
||||
entry.push_back(Pair("txid", txHash.GetHex()));
|
||||
entry.push_back(Pair("hash", tx.GetWitnessHash().GetHex()));
|
||||
entry.push_back(Pair("hash", tx.GetHashWithWitness().GetHex()));
|
||||
|
||||
UniValue deps(UniValue::VARR);
|
||||
BOOST_FOREACH (const CTxIn &in, tx.vin)
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ void ScriptPubKeyToJSON(const CScript& scriptPubKey, UniValue& out, bool fInclud
|
|||
void TxToJSON(const CTransaction& tx, const uint256 hashBlock, UniValue& entry)
|
||||
{
|
||||
entry.push_back(Pair("txid", tx.GetHash().GetHex()));
|
||||
entry.push_back(Pair("hash", tx.GetWitnessHash().GetHex()));
|
||||
entry.push_back(Pair("hash", tx.GetHashWithWitness().GetHex()));
|
||||
entry.push_back(Pair("size", (int)::GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION)));
|
||||
entry.push_back(Pair("vsize", (int)::GetVirtualTransactionSize(tx)));
|
||||
entry.push_back(Pair("version", tx.nVersion));
|
||||
|
|
|
|||
|
|
@ -445,7 +445,7 @@ bool CTxMemPool::addUnchecked(const uint256& hash, const CTxMemPoolEntry &entry,
|
|||
totalTxSize += entry.GetTxSize();
|
||||
minerPolicyEstimator->processTransaction(entry, validFeeEstimate);
|
||||
|
||||
vTxHashes.emplace_back(tx.GetWitnessHash(), newit);
|
||||
vTxHashes.emplace_back(tx.GetHashWithWitness(), newit);
|
||||
newit->vTxHashesIdx = vTxHashes.size() - 1;
|
||||
|
||||
typedef std::pair<uint256, COutPoint> WithdrawPair;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue