From fdf82fba3105c3c824e594db8cd7c55c4f692744 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hampus=20Sj=C3=B6berg?= Date: Tue, 6 Sep 2016 22:30:30 +0200 Subject: Adding method GetTotalSize() to CTransaction GetTotalSize() returns the total transaction size (including witness) in bytes. --- src/primitives/transaction.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/primitives/transaction.h') diff --git a/src/primitives/transaction.h b/src/primitives/transaction.h index 5689d15bf7..16c2e5c454 100644 --- a/src/primitives/transaction.h +++ b/src/primitives/transaction.h @@ -415,6 +415,13 @@ public: // Compute modified tx size for priority calculation (optionally given tx size) unsigned int CalculateModifiedSize(unsigned int nTxSize=0) const; + + /** + * Get the total transaction size in bytes, including witness data. + * "Total Size" defined in BIP141 and BIP144. + * @return Total transaction size in bytes + */ + unsigned int GetTotalSize() const; bool IsCoinBase() const { -- cgit v1.2.3