Author

Topic: Computing transaction hash (Read 192 times)

legendary
Activity: 1584
Merit: 1280
Heisenberg Design Services
March 11, 2019, 06:41:46 AM
#2
If you had done a general search in the code base you could have got them,

The CTransaction::ComputeHash() is present in bitcoin/src/primitives/transaction.cpp #L65

Code:
uint256 CTransaction::ComputeHash() const
{
    return SerializeHash(*this, SER_GETHASH, SERIALIZE_TRANSACTION_NO_WITNESS);
}

uint256 CTransaction::ComputeWitnessHash() const
{
    if (!HasWitness()) {
        return hash;
    }
    return SerializeHash(*this, SER_GETHASH, 0);
}

BTW what are you trying to achieve with this?  Huh
member
Activity: 138
Merit: 25
March 11, 2019, 05:17:13 AM
#1
Where in code is computing transaction hash?
CTransaction::ComputeHash()?
Jump to: