This file contains hidden or 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
//Shows how to print a bitcoin script to stdout | |
#include <iostream> | |
#include "core_write.h" | |
cout << "Script being executed: " << ScriptToAsmStr(script) << std::endl; |
This file contains hidden or 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
chris@chris:~/.../src/test$ ./test_bitcoin -t script_tests/script_valid | |
Running 1 test case... | |
tests: [["Automatically generated test cases"],["0x47 0x304402200a5c6163f07b8d3b013c4d1d6dba25e780b39658d79ba37af7057a3b7f15ffa102201fd9b4eaa9943f734928b99a83592c2e7bf342ea2680f6a2bb705167966b742001","0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG","","P2PK"]] | |
Transaction: 01000000019ce5586f04dd407719ab7e2ed3583583b9022f29652702cfac5ed082013461fe000000004847304402200a5c6163f07b8d3b013c4d1d6dba25e780b39658d79ba37af7057a3b7f15ffa102201fd9b4eaa9943f734928b99a83592c2e7bf342ea2680f6a2bb705167966b742001ffffffff0100000000000000000000000000 | |
Done | |
*** No errors detected |
This file contains hidden or 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
CDataStream ss(SER_NETWORK, PROTOCOL_VERSION); | |
ss << tx; | |
printf("Transaction: %s\n", HexStr(ss).c_str()); |
This file contains hidden or 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
//OP_0 OP_IF,OP_1, OP_IF,OP_RETURN, OP_ELSE, OP_RETURN, OP_ELSE, OP_RETURN,OP_ENDIF, | |
//OP_ELSE, OP_1,OP_IF,OP_1,OP_ELSE, | |
//OP_RETURN,OP_ELSE,OP_1,OP_ENDIF, OP_ELSE,OP_RETURN,OP_ENDIF,OP_ADD,OP_2,OP_EQUAL | |
OP_0 | |
OP_IF | |
OP_1 | |
OP_IF | |
OP_RETURN | |
OP_ELSE | |
OP_RETURN |
This file contains hidden or 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
//"0", "IF 1 IF RETURN ELSE RETURN ELSE RETURN ENDIF ELSE 1 IF 1 ELSE RETURN ELSE 1 ENDIF ELSE RETURN ENDIF ADD 2 EQUAL | |
0 | |
OP_IF | |
1 | |
OP_IF | |
OP_RETURN | |
OP_ELSE | |
OP_RETURN | |
OP_ELSE |
This file contains hidden or 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
//1 OP_IF, OP_IF, OP_1, OP_ELSE, OP_0, OP_ENDIF, OP_ELSE, OP_IF, OP_0, OP_ELSE, OP_1, OP_ENDIF, OP_ENDIF | |
1 | |
OP_IF | |
OP_IF | |
OP_1 | |
OP_ELSE | |
OP_0 | |
OP_ENDIF | |
OP_ELSE | |
OP_IF |
This file contains hidden or 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 script | |
//0 IF 1 IF RETURN ELSE RETURN ELSE RETURN ENDIF ELSE 1 IF 1 ELSE RETURN ELSE 1 ENDIF ELSE RETURN ENDIF ADD 2 EQUAL | |
//OP_IF RULE | |
//If the top stack value is not 0, the statements are executed. The top stack value is removed. | |
//OP_ELSE RULE | |
//If the preceding OP_IF or OP_NOTIF or OP_ELSE was not executed then these statements are and | |
//if the preceding OP_IF or OP_NOTIF or OP_ELSE was executed then these statements are not. | |
0 |
NewerOlder