@@ -31,16 +31,11 @@ CFluid fluid;
3131extern CWallet* pwalletMain;
3232#endif // ENABLE_WALLET
3333
34- bool IsTransactionFluid (const CScript& txOut)
35- {
36- return WithinFluidRange (txOut.GetFlag ());
37- }
38-
3934bool IsTransactionFluid (const CTransaction& tx, CScript& fluidScript)
4035{
4136 for (const CTxOut& txout : tx.vout ) {
4237 CScript txOut = txout.scriptPubKey ;
43- if (IsTransactionFluid (txOut)) {
38+ if (WithinFluidRange (txOut. GetFlag () )) {
4439 fluidScript = txOut;
4540 return true ;
4641 }
@@ -122,7 +117,7 @@ bool CFluid::CheckIfExistsInMemPool(const CTxMemPool& pool, const CScript& fluid
122117 for (const CTxMemPoolEntry& e : pool.mapTx ) {
123118 const CTransaction& tx = e.GetTx ();
124119 for (const CTxOut& txOut : tx.vout ) {
125- if (IsTransactionFluid (txOut.scriptPubKey )) {
120+ if (WithinFluidRange (txOut.scriptPubKey . GetFlag () )) {
126121 return (GetRidOfScriptStatement (ScriptToAsmStr (fluidScriptPubKey)) == GetRidOfScriptStatement (ScriptToAsmStr (txOut.scriptPubKey )));
127122 }
128123 }
@@ -438,7 +433,7 @@ bool CFluid::GetMintingInstructions(const CBlockIndex* pblockindex, CDynamicAddr
438433/* Check if transaction exists in record */
439434bool CFluid::CheckTransactionInRecord (const CScript& fluidInstruction, CBlockIndex* pindex)
440435{
441- if (IsTransactionFluid (fluidInstruction)) {
436+ if (WithinFluidRange (fluidInstruction. GetFlag () )) {
442437 std::string verificationString = ScriptToAsmStr (fluidInstruction);
443438 std::vector<std::string> transactionRecord;
444439 std::string verificationWithoutOpCode = GetRidOfScriptStatement (verificationString);
@@ -490,7 +485,7 @@ bool CFluid::ValidationProcesses(CValidationState& state, const CScript& txOut,
490485 CAmount mintAmount;
491486 CDynamicAddress toMintAddress;
492487
493- if (IsTransactionFluid (txOut)) {
488+ if (WithinFluidRange (txOut. GetFlag () )) {
494489 if (!CheckIfQuorumExists (ScriptToAsmStr (txOut), message)) {
495490 return state.DoS (100 , false , REJECT_INVALID, " bad-txns-fluid-auth-failure" );
496491 }
@@ -515,7 +510,7 @@ bool CFluid::ProvisionalCheckTransaction(const CTransaction& transaction)
515510 for (const CTxOut& txout : transaction.vout ) {
516511 CScript txOut = txout.scriptPubKey ;
517512
518- if (IsTransactionFluid (txOut) && CheckTransactionInRecord (txOut)) {
513+ if (WithinFluidRange (txOut. GetFlag () ) && CheckTransactionInRecord (txOut)) {
519514 LogPrintf (" ProvisionalCheckTransaction(): Fluid Transaction %s has already been executed!\n " , transaction.GetHash ().ToString ());
520515 return false ;
521516 }
@@ -540,7 +535,7 @@ bool CFluid::CheckTransactionToBlock(const CTransaction& transaction, const uint
540535 for (const CTxOut& txout : transaction.vout ) {
541536 CScript txOut = txout.scriptPubKey ;
542537
543- if (IsTransactionFluid (txOut) && CheckTransactionInRecord (txOut, pblockindex)) {
538+ if (WithinFluidRange (txOut. GetFlag () ) && CheckTransactionInRecord (txOut, pblockindex)) {
544539 LogPrintf (" CheckTransactionToBlock(): Fluid Transaction %s has already been executed!\n " , transaction.GetHash ().ToString ());
545540 return false ;
546541 }
0 commit comments