Bitcoin Forum
May 12, 2024, 05:01:54 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Computing transaction hash  (Read 168 times)
Frodek (OP)
Member
**
Offline Offline

Activity: 138
Merit: 25


View Profile
March 11, 2019, 10:17:13 AM
 #1

Where in code is computing transaction hash?
CTransaction::ComputeHash()?
1715533314
Hero Member
*
Offline Offline

Posts: 1715533314

View Profile Personal Message (Offline)

Ignore
1715533314
Reply with quote  #2

1715533314
Report to moderator
1715533314
Hero Member
*
Offline Offline

Posts: 1715533314

View Profile Personal Message (Offline)

Ignore
1715533314
Reply with quote  #2

1715533314
Report to moderator
1715533314
Hero Member
*
Offline Offline

Posts: 1715533314

View Profile Personal Message (Offline)

Ignore
1715533314
Reply with quote  #2

1715533314
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
Heisenberg_Hunter
Legendary
*
Offline Offline

Activity: 1583
Merit: 1276


Heisenberg Design Services


View Profile WWW
March 11, 2019, 11: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
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!