Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: lovecodelc on October 08, 2016, 02:42:45 AM



Title: what dose CTxWitness use for?
Post by: lovecodelc on October 08, 2016, 02:42:45 AM
Bitcoin Core code defines class data type "CTransaction", i see it has a data member:CTxWitness, what dose CTxWitness use for?
and it has a data member:const uint256 hash /** Memory only. */, it means if a transaction in mempool, it has this data member:hash?
or if on disk, it has no data member:hash?

thank you.


Title: Re: what dose CTxWitness use for?
Post by: achow101 on October 08, 2016, 03:49:42 AM
CTxWitness is for segwit. Specifically it is for the witnesses included in the segwit serialization.

and it has a data member:const uint256 hash /** Memory only. */, it means if a transaction in mempool, it has this data member:hash?
or if on disk, it has no data member:hash?
It means that that hash is kept in the memory and not on disk.


Title: Re: what dose CTxWitness use for?
Post by: lovecodelc on October 08, 2016, 06:18:18 AM
Thank you.

CTxWitness is for segwit. Specifically it is for the witnesses included in the segwit serialization.

and it has a data member:const uint256 hash /** Memory only. */, it means if a transaction in mempool, it has this data member:hash?
or if on disk, it has no data member:hash?
It means that that hash is kept in the memory and not on disk.


Title: Re: what dose CTxWitness use for?
Post by: IS1982 on October 09, 2016, 08:58:30 PM
achow101 thanks for your answear. I was looking for it for a long time.