Skip to content

Commit

Permalink
Merge pull request #151 from VerusCoin/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
Asherda committed Oct 29, 2018
2 parents 672d319 + f4780ce commit 6c24104
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/main.cpp
Expand Up @@ -4542,6 +4542,8 @@ bool CheckBlock(int32_t *futureblockp,int32_t height,CBlockIndex *pindex,const C
REJECT_INVALID, "bad-cb-multiple");

// Check transactions
CTransaction sTx;
CTransaction *ptx = NULL;
if ( ASSETCHAINS_CC != 0 ) // CC contracts might refer to transactions in the current block, from a CC spend within the same block and out of order
{
int32_t i,j,rejects=0,lastrejects=0;
Expand All @@ -4562,9 +4564,10 @@ bool CheckBlock(int32_t *futureblockp,int32_t height,CBlockIndex *pindex,const C
// take advantage of other checks, but if we were only rejected because it is a valid staking
// transaction, sync with wallets and don't mark as a reject
if (i == (block.vtx.size() - 1) && ASSETCHAINS_LWMAPOS && block.IsVerusPOSBlock() && state.GetRejectReason() == "staking")
SyncWithWallets(Tx, &block);
else
rejects++;
{
sTx = Tx;
ptx = &sTx;
} else rejects++;
}
}
if ( rejects == 0 || rejects == lastrejects )
Expand Down Expand Up @@ -4604,6 +4607,11 @@ bool CheckBlock(int32_t *futureblockp,int32_t height,CBlockIndex *pindex,const C
LogPrintf("CheckBlockHeader komodo_check_deposit error");
return(false);
}

if (ptx)
{
SyncWithWallets(*ptx, &block);
}
return true;
}

Expand Down

0 comments on commit 6c24104

Please sign in to comment.