Skip to content

Commit

Permalink
Update mm2lib.py
Browse files Browse the repository at this point in the history
  • Loading branch information
tonymorony authored May 15, 2020
1 parent 74b8864 commit f1f95db
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/mm2lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@


def payment_script(time_lock, secret_hash, pub_0, pub_1):
"""
this function making payment script for mm2 atomic swap
ported from mm2 rust code
"""
return CScript([OP_IF, struct.pack('<I', time_lock), OP_NOP2 , OP_DROP, pub_0, OP_CHECKSIG,
OP_ELSE, OP_SIZE, b'\x20', OP_EQUALVERIFY, OP_HASH160, secret_hash, OP_EQUALVERIFY, pub_1, OP_CHECKSIG, OP_ENDIF])

Expand Down

0 comments on commit f1f95db

Please sign in to comment.