forked from bitcoin/bitcoin
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace: CScript::mscore_parse(..) by GetScriptPushes(..)
Instead of using a modified version of CScript::ToString(), CScript::mscore_parse(,,) was replaced by an external function, which collects pushed values in a script. The original state of script.h is now contained.
- Loading branch information
Showing
5 changed files
with
41 additions
and
36 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#include "mastercore_script.h" | ||
|
||
#include "script.h" | ||
#include "util.h" | ||
|
||
#include <string> | ||
#include <vector> | ||
|
||
bool GetScriptPushes(const CScript& scriptIn, std::vector<std::string>& vstrRet, bool fSkipFirst) | ||
{ | ||
int count = 0; | ||
CScript::const_iterator pc = scriptIn.begin(); | ||
while (pc < scriptIn.end()) | ||
{ | ||
opcodetype opcode; | ||
std::vector<unsigned char> data; | ||
if (!scriptIn.GetOp(pc, opcode, data)) | ||
return false; | ||
if (0 <= opcode && opcode <= OP_PUSHDATA4) | ||
if (count++ || !fSkipFirst) vstrRet.push_back(HexStr(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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#ifndef MASTERCOIN_SCRIPT_H | ||
#define MASTERCOIN_SCRIPT_H | ||
|
||
#include <string> | ||
#include <vector> | ||
|
||
class CScript; | ||
|
||
bool GetScriptPushes(const CScript& scriptIn, std::vector<std::string>& vstrRet, bool fSkipFirst = false); | ||
|
||
#endif // MASTERCOIN_SCRIPT_H |
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