-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal: Add basic simnet xmr swap.
- Loading branch information
1 parent
5736f60
commit ac416c1
Showing
5 changed files
with
1,260 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package dcr | ||
|
||
import "github.com/decred/dcrd/txscript/v4" | ||
|
||
func LockRefundTxScript(kal, kaf []byte, locktime int64) ([]byte, error) { | ||
return txscript.NewScriptBuilder(). | ||
AddOp(txscript.OP_IF). | ||
AddOp(txscript.OP_2). | ||
AddData(kal). | ||
AddData(kaf). | ||
AddOp(txscript.OP_2). | ||
AddOp(txscript.OP_CHECKMULTISIG). | ||
AddOp(txscript.OP_ELSE). | ||
AddInt64(locktime). | ||
AddOp(txscript.OP_CHECKSEQUENCEVERIFY). | ||
AddOp(txscript.OP_DROP). | ||
AddData(kaf). | ||
AddOp(txscript.OP_CHECKSIG). | ||
AddOp(txscript.OP_ENDIF). | ||
Script() | ||
} | ||
|
||
func LockTxScript(kal, kaf []byte) ([]byte, error) { | ||
return txscript.NewScriptBuilder(). | ||
AddOp(txscript.OP_2). | ||
AddData(kal). | ||
AddData(kaf). | ||
AddOp(txscript.OP_2). | ||
AddOp(txscript.OP_CHECKMULTISIG). | ||
Script() | ||
} |
Oops, something went wrong.