forked from michaelliao/cryptocurrency
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0ca92a5
commit 5c8d463
Showing
23 changed files
with
662 additions
and
360 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
bitcoin-script/src/main/java/com/itranswarp/bitcoin/script/DataOp.java
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,25 @@ | ||
package com.itranswarp.bitcoin.script; | ||
|
||
import com.itranswarp.bitcoin.util.HashUtils; | ||
|
||
/** | ||
* Data op is executed by script engine directly. | ||
* | ||
* @author liaoxuefeng | ||
*/ | ||
public class DataOp extends Op { | ||
|
||
final byte[] data; | ||
|
||
DataOp(int code, byte[] data) { | ||
super(code, "DATA(" + HashUtils.toHexString(data) + ")"); | ||
this.data = data; | ||
} | ||
|
||
@Override | ||
public boolean execute(ScriptContext context) { | ||
log.info("push data: " + HashUtils.toHexString(data)); | ||
context.push(data); | ||
return true; | ||
} | ||
} |
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
Oops, something went wrong.