Browse Source

Use get_deser_from_gettransaction() everywhere

master
Kristaps Kaupe 2 years ago
parent
commit
fab97a003b
No known key found for this signature in database
GPG Key ID: 33E472FE870C7E5D
  1. 8
      src/jmclient/wallet_utils.py

8
src/jmclient/wallet_utils.py

@ -384,8 +384,8 @@ def get_tx_info(txid: str, tx_cache: Optional[dict] = None) -> Tuple[
rpctx, rpctx_deser = tx_cache[txid] rpctx, rpctx_deser = tx_cache[txid]
else: else:
rpctx = jm_single().bc_interface.get_transaction(txid) rpctx = jm_single().bc_interface.get_transaction(txid)
txhex = str(rpctx['hex']) rpctx_deser = jm_single().bc_interface.get_deser_from_gettransaction(
rpctx_deser = btc.CMutableTransaction.deserialize(hextobin(txhex)) rpctx)
if tx_cache is not None: if tx_cache is not None:
tx_cache[txid] = (rpctx, rpctx_deser) tx_cache[txid] = (rpctx, rpctx_deser)
output_script_values = {x.scriptPubKey: x.nValue for x in rpctx_deser.vout} output_script_values = {x.scriptPubKey: x.nValue for x in rpctx_deser.vout}
@ -912,8 +912,8 @@ def wallet_fetch_history(wallet, options):
wallet_tx = jm_single().bc_interface.get_transaction( wallet_tx = jm_single().bc_interface.get_transaction(
ins.prevout.hash[::-1]) ins.prevout.hash[::-1])
if wallet_tx: if wallet_tx:
wallet_tx_deser = btc.CMutableTransaction.deserialize( wallet_tx_deser = jm_single.bc_interface(
hextobin(wallet_tx['hex'])) ).get_deser_from_gettransaction(wallet_tx)
tx_cache[ins.prevout.hash[::-1]] = (wallet_tx, tx_cache[ins.prevout.hash[::-1]] = (wallet_tx,
wallet_tx_deser) wallet_tx_deser)
if wallet_tx is None: if wallet_tx is None:

Loading…
Cancel
Save