From dfc84b632473c84c3b4ed4e2f1c07e520aa64abb Mon Sep 17 00:00:00 2001 From: 4tochka Date: Sun, 1 Apr 2018 01:32:38 +0400 Subject: [PATCH] block template class --- pybtc/blockchain.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pybtc/blockchain.py b/pybtc/blockchain.py index 775a773..7716120 100644 --- a/pybtc/blockchain.py +++ b/pybtc/blockchain.py @@ -901,5 +901,9 @@ class BlockTemplate(): cbh = double_sha256(unhexlify(cb)) merkle_root = merkleroot_from_branches(self.merkle_branches, cbh) header = version + prev_hash + merkle_root + time + bits + nonce - return double_sha256(header,1) + block = hexlify(header) + block += cb + for t in self.transactions: + block += t["data"] + return double_sha256(header,1), block