From 9b00e4b475d1ccf41b7584148ea783b1e24f3df0 Mon Sep 17 00:00:00 2001 From: Ethan Heilman Date: Wed, 31 Dec 2014 18:01:31 -0500 Subject: [PATCH] Fixing bug where to_bytes clobbers testnet params. --- bitcoin/messages.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/bitcoin/messages.py b/bitcoin/messages.py index aa6aeddf..420f6581 100644 --- a/bitcoin/messages.py +++ b/bitcoin/messages.py @@ -33,7 +33,7 @@ from bitcoin.core import * from bitcoin.core.serialize import * from bitcoin.net import * -from bitcoin import MainParams +import bitcoin MSG_TX = 1 MSG_BLOCK = 2 @@ -51,11 +51,11 @@ def msg_ser(self, f): def msg_deser(cls, f, protover=PROTO_VERSION): raise NotImplementedError - def to_bytes(self, params=MainParams()): + def to_bytes(self): f = _BytesIO() self.msg_ser(f) body = f.getvalue() - res = params.MESSAGE_START + res = bitcoin.params.MESSAGE_START res += self.command res += b"\x00" * (12 - len(self.command)) res += struct.pack(b"