From 326af131839ce7b1561f67014510fe6ae8771b1b Mon Sep 17 00:00:00 2001 From: Dusan Klinec Date: Thu, 13 Sep 2018 08:09:20 +0200 Subject: [PATCH] xmr: msg dump with prefix --- src/apps/monero/controller/misc.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/apps/monero/controller/misc.py b/src/apps/monero/controller/misc.py index bbcbe2312..6ad446f6e 100644 --- a/src/apps/monero/controller/misc.py +++ b/src/apps/monero/controller/misc.py @@ -64,11 +64,13 @@ def parse_vini(bts): return parse_msg(bts, TxinToKey()) -def dump_msg(msg, preallocate=None, msg_type=None): +def dump_msg(msg, preallocate=None, msg_type=None, prefix=None): from apps.monero.xmr.serialize import xmrserialize from apps.monero.xmr.serialize.readwriter import MemoryReaderWriter writer = MemoryReaderWriter(preallocate=preallocate) + if prefix: + writer.write(prefix) ar = xmrserialize.Archive(writer, True) ar.message(msg, msg_type=msg_type) return writer.get_buffer()