Set expiry on stake transactions to allow deletion from wallets later to avoid possible double stake
This commit is contained in:
@@ -3760,7 +3760,8 @@ bool static DisconnectTip(CValidationState &state, bool fBare = false) {
|
|||||||
for (int i = 0; i < block.vtx.size(); i++)
|
for (int i = 0; i < block.vtx.size(); i++)
|
||||||
{
|
{
|
||||||
CTransaction &tx = block.vtx[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());
|
EraseFromWallets(tx.GetHash());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 we are staking with the extended format, add the opreturn data required
|
||||||
if (extendedStake)
|
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();
|
uint256 srcBlock = uint256();
|
||||||
CBlockIndex *pSrcIndex;
|
CBlockIndex *pSrcIndex;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user