Get the transaction ID. This differs from the transactions hash as given by GetHash. GetTxid excludes witness data, while GetHash includes it.
(self)
| 434 | return cls(tx.vin, tx.vout, tx.nLockTime, tx.nVersion, tx.wit) |
| 435 | |
| 436 | def GetTxid(self): |
| 437 | """Get the transaction ID. |
| 438 | |
| 439 | This differs from the transactions hash as given by GetHash. GetTxid |
| 440 | excludes witness data, while GetHash includes it. |
| 441 | """ |
| 442 | if self.wit != CTxWitness(): |
| 443 | txid = Hash(CTransaction(self.vin, self.vout, self.nLockTime, |
| 444 | self.nVersion).serialize()) |
| 445 | else: |
| 446 | txid = Hash(self.serialize()) |
| 447 | return txid |
| 448 | |
| 449 | def calc_weight(self): |
| 450 | """Calculate the transaction weight, as defined by BIP141. |