Skip to content

Commit 6602cb4

Browse files
committed
Do not truncate refund amount when printing debug data to the user
Since '%d' was used, refund values are being truncated from display. This fix uses the floating point '%.16g' format flag instead, the same flag used for displaying the value.
1 parent 1ac550c commit 6602cb4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

contrib/sidechain-manipulation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def __init__(self, value):
162162
in_vout = utxo.in_vout
163163
in_value = utxo.in_value
164164

165-
print("Redeeming from utxo %s:%.16g (value %.16g, refund %d)" % (in_txid, in_vout, in_value, in_value - value))
165+
print("Redeeming from utxo %s:%.16g (value %.16g, refund %.16g)" % (in_txid, in_vout, in_value, in_value - value))
166166

167167
withdrawkeys = 'withdrawkeys:{"contract": "%s", "txoutproof": "%s", "tx": "%s", "nout": %d, "secondScriptPubKey": "%s", "secondScriptSig": "%s", "coinbase": "%s"}' % (full_contract, spv_proof, raw_bitcoin_tx_hex, nout, secondScriptPubKey, secondScriptSig, raw_coinbase_tx_hex)
168168
out_scriptPubKey = "OP_IF %d 0x20%s %d 0 0x14%s 0x20%s OP_REORGPROOFVERIFY OP_ELSE 144 OP_NOP3 OP_DROP OP_HASH160 0x14%s OP_EQUAL OP_ENDIF" % (bitcoin_block["height"], sys.argv[4], nout, secondScriptPubKeyHash, inverse_bitcoin_genesis_hash, raw_dest)

0 commit comments

Comments
 (0)