• R/O
  • HTTP
  • SSH
  • HTTPS

bytom-kit: 提交

kaleidoscope


Commit MetaInfo

修订版86b36dec20dcdf9d88d11d76fc0f228ecde9f834 (tree)
时间2019-03-20 12:26:02
作者Chengcheng Zhang <943420582@qq.c...>
CommiterChengcheng Zhang

Log Message

fix bug

更改概述

差异

--- a/app/model/transaction.py
+++ b/app/model/transaction.py
@@ -248,6 +248,8 @@ def decode_raw_tx(raw_tx_str, network_str):
248248 tx_input['input_id'] = get_issue_input_id(prepare_issue_hexstr)
249249 tx['inputs'].append(tx_input)
250250 prepare_mux_hexstr += tx_input['input_id'] + tx_input['asset_id'] + (tx_input['amount']).to_bytes(8, byteorder='little').hex() + '0000000000000000'
251+ prepare_mux_hexstr += '0100000000000000' + '0151'
252+ mux_id_hexstr = get_mux_id(prepare_mux_hexstr)
251253 elif input_type == 1: # spend
252254 tx_input = {
253255 "address": "",
@@ -293,6 +295,8 @@ def decode_raw_tx(raw_tx_str, network_str):
293295 tx_input['witness_arguments'].append(argument)
294296 tx['inputs'].append(tx_input)
295297 prepare_mux_hexstr += tx_input['input_id'] + tx_input['asset_id'] + (tx_input['amount']).to_bytes(8, byteorder='little').hex() + '0000000000000000'
298+ prepare_mux_hexstr += '0100000000000000' + '0151'
299+ mux_id_hexstr = get_mux_id(prepare_mux_hexstr)
296300 elif input_type == 2: # coinbase
297301 tx_input = {
298302 "amount": 0,
@@ -314,12 +318,8 @@ def decode_raw_tx(raw_tx_str, network_str):
314318 offset = offset + 2
315319 tx['inputs'].append(tx_input)
316320 prepare_mux_hexstr += tx_input['input_id'] + 'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff'
317- if tx_input['type'] == "coinbase":
318- offset = offset + 2 * length
319321 tx_output_amount, length = get_uvarint(raw_tx_str[offset:offset+18])
320- if (tx_input['type'] == "issue") or (tx_input['type'] == "spend"):
321- prepare_mux_hexstr += '0100000000000000' + '0151'
322- mux_id_hexstr = get_mux_id(prepare_mux_hexstr)
322+ offset = offset + 2 * length
323323 prepare_tx_id_hexstr += (tx_output_amount).to_bytes((tx_output_amount.bit_length() + 7) // 8, 'little').hex()
324324 for i in range(tx_output_amount):
325325 tx_output = {
Show on old repository browser