Set expiry on stake transactions to allow deletion from wallets later to avoid possible double stake

This commit is contained in:
miketout
2018-11-02 12:49:36 -07:00
parent b276e36826
commit 7a993143ef
2 changed files with 5 additions and 1 deletions

View File

@@ -3760,7 +3760,8 @@ bool static DisconnectTip(CValidationState &state, bool fBare = false) {
for (int i = 0; i < block.vtx.size(); i++)
{
CTransaction &tx = block.vtx[i];
if ((i == (block.vtx.size() - 1)) && ((ASSETCHAINS_LWMAPOS && block.IsVerusPOSBlock()) || (ASSETCHAINS_STAKED != 0 && (komodo_isPoS((CBlock *)&block) != 0))))
//if ((i == (block.vtx.size() - 1)) && ((ASSETCHAINS_LWMAPOS && block.IsVerusPOSBlock()) || (ASSETCHAINS_STAKED != 0 && (komodo_isPoS((CBlock *)&block) != 0))))
if ((i == (block.vtx.size() - 1)) && (ASSETCHAINS_STAKED != 0 && (komodo_isPoS((CBlock *)&block) != 0)))
{
EraseFromWallets(tx.GetHash());
}

View File

@@ -1424,6 +1424,9 @@ int32_t CWallet::VerusStakeTransaction(CBlock *pBlock, CMutableTransaction &txNe
// if we are staking with the extended format, add the opreturn data required
if (extendedStake)
{
// set expiry to time out after 100 blocks, so we can remove the transaction if it orphans
txNew.nExpiryHeight = stakeHeight + 100;
uint256 srcBlock = uint256();
CBlockIndex *pSrcIndex;