Skip to content

Commit

Permalink
[Refactor] Rename CCSV opcode to OP_CHECKCOLDSTAKEVERIFY_LOF
Browse files Browse the repository at this point in the history
Last Output Free
  • Loading branch information
random-zebra committed May 11, 2021
1 parent 44ddf8a commit b194386
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/script/interpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -960,7 +960,7 @@ bool EvalScript(std::vector<std::vector<unsigned char> >& stack, const CScript&
}
break;

case OP_CHECKCOLDSTAKEVERIFY:
case OP_CHECKCOLDSTAKEVERIFY_LOF:
{
if (g_IsV6Active) {
// the stack can contain only <sig> <pk> <pkh> at this point
Expand Down
4 changes: 2 additions & 2 deletions src/script/script.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ const char* GetOpName(opcodetype opcode)
case OP_ZEROCOINPUBLICSPEND : return "OP_ZEROCOINPUBLICSPEND";

// cold staking
case OP_CHECKCOLDSTAKEVERIFY : return "OP_CHECKCOLDSTAKEVERIFY";
case OP_CHECKCOLDSTAKEVERIFY_LOF : return "OP_CHECKCOLDSTAKEVERIFY_LOF";

case OP_INVALIDOPCODE : return "OP_INVALIDOPCODE";

Expand Down Expand Up @@ -236,7 +236,7 @@ bool CScript::IsPayToColdStaking() const
(!g_IsV6Active || (*this)[1] == OP_HASH160) &&
(*this)[2] == OP_ROT &&
(!g_IsV6Active || (*this)[3] == OP_IF) &&
(*this)[4] == OP_CHECKCOLDSTAKEVERIFY &&
(*this)[4] == OP_CHECKCOLDSTAKEVERIFY_LOF &&
(*this)[5] == 0x14 &&
(!g_IsV6Active || (*this)[26] == OP_ELSE) &&
(*this)[27] == 0x14 &&
Expand Down
2 changes: 1 addition & 1 deletion src/script/script.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ enum opcodetype
OP_ZEROCOINPUBLICSPEND = 0xc3,

// cold staking
OP_CHECKCOLDSTAKEVERIFY = 0xd1,
OP_CHECKCOLDSTAKEVERIFY_LOF = 0xd1, // last output free for masternode/budget payments

OP_INVALIDOPCODE = 0xff,
};
Expand Down
2 changes: 1 addition & 1 deletion src/script/standard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ CScript GetScriptForStakeDelegation(const CKeyID& stakingKey, const CKeyID& spen
{
CScript script;
script << OP_DUP << OP_HASH160 << OP_ROT <<
OP_IF << OP_CHECKCOLDSTAKEVERIFY << ToByteVector(stakingKey) <<
OP_IF << OP_CHECKCOLDSTAKEVERIFY_LOF << ToByteVector(stakingKey) <<
OP_ELSE << ToByteVector(spendingKey) << OP_ENDIF <<
OP_EQUALVERIFY << OP_CHECKSIG;
return script;
Expand Down
2 changes: 1 addition & 1 deletion src/test/script_P2CS_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ static CScript GetFakeLockingScript(const CKeyID staker, const CKeyID& owner)
{
CScript script;
script << opcodetype(0x2F) << opcodetype(0x01) << OP_ROT <<
OP_IF << OP_CHECKCOLDSTAKEVERIFY << ToByteVector(staker) <<
OP_IF << OP_CHECKCOLDSTAKEVERIFY_LOF << ToByteVector(staker) <<
OP_ELSE << ToByteVector(owner) << OP_DROP <<
OP_EQUALVERIFY << OP_CHECKSIG;

Expand Down

0 comments on commit b194386

Please sign in to comment.