Expire Overwinter transactions before the Sapling activation height
This commit is contained in:
@@ -3674,9 +3674,6 @@ UniValue z_sendmany(const UniValue& params, bool fHelp)
|
||||
if (contextualTx.nVersion == 1 && isShielded) {
|
||||
contextualTx.nVersion = 2; // Tx format should support vjoinsplits
|
||||
}
|
||||
if (NetworkUpgradeActive(nextBlockHeight, Params().GetConsensus(), Consensus::UPGRADE_OVERWINTER)) {
|
||||
contextualTx.nExpiryHeight = nextBlockHeight + expiryDelta;
|
||||
}
|
||||
|
||||
// Create operation and add to global queue
|
||||
std::shared_ptr<AsyncRPCQueue> q = getAsyncRPCQueue();
|
||||
@@ -3872,9 +3869,6 @@ UniValue z_shieldcoinbase(const UniValue& params, bool fHelp)
|
||||
if (contextualTx.nVersion == 1) {
|
||||
contextualTx.nVersion = 2; // Tx format should support vjoinsplits
|
||||
}
|
||||
if (overwinterActive) {
|
||||
contextualTx.nExpiryHeight = nextBlockHeight + expiryDelta;
|
||||
}
|
||||
|
||||
// Create operation and add to global queue
|
||||
std::shared_ptr<AsyncRPCQueue> q = getAsyncRPCQueue();
|
||||
@@ -4211,9 +4205,6 @@ UniValue z_mergetoaddress(const UniValue& params, bool fHelp)
|
||||
if (contextualTx.nVersion == 1 && isShielded) {
|
||||
contextualTx.nVersion = 2; // Tx format should support vjoinsplit
|
||||
}
|
||||
if (overwinterActive) {
|
||||
contextualTx.nExpiryHeight = nextBlockHeight + expiryDelta;
|
||||
}
|
||||
|
||||
// Create operation and add to global queue
|
||||
std::shared_ptr<AsyncRPCQueue> q = getAsyncRPCQueue();
|
||||
|
||||
@@ -2580,13 +2580,10 @@ bool CWallet::CreateTransaction(const vector<CRecipient>& vecSend, CWalletTx& wt
|
||||
Params().GetConsensus(), nextBlockHeight);
|
||||
|
||||
// Activates after Overwinter network upgrade
|
||||
// Set nExpiryHeight to expiryDelta (default 20) blocks past current block height
|
||||
if (NetworkUpgradeActive(nextBlockHeight, Params().GetConsensus(), Consensus::UPGRADE_OVERWINTER)) {
|
||||
if (nextBlockHeight + expiryDelta >= TX_EXPIRY_HEIGHT_THRESHOLD){
|
||||
if (txNew.nExpiryHeight >= TX_EXPIRY_HEIGHT_THRESHOLD){
|
||||
strFailReason = _("nExpiryHeight must be less than TX_EXPIRY_HEIGHT_THRESHOLD.");
|
||||
return false;
|
||||
} else {
|
||||
txNew.nExpiryHeight = nextBlockHeight + expiryDelta;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user