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"