Fix non-final sequence and nLockTime
This commit is contained in:
@@ -225,7 +225,7 @@ bool ShieldToAddress::operator()(const libzcash::SproutPaymentAddress &zaddr) co
|
||||
for (ShieldCoinbaseUTXO & t : m_op->inputs_) {
|
||||
CTxIn in(COutPoint(t.txid, t.vout));
|
||||
if (t.amount >= ASSETCHAINS_TIMELOCKGTE)
|
||||
in.nSequence = 0;
|
||||
in.nSequence = 0xfffffffe;
|
||||
rawTx.vin.push_back(in);
|
||||
}
|
||||
m_op->tx_ = CTransaction(rawTx);
|
||||
@@ -272,8 +272,8 @@ bool ShieldToAddress::operator()(const libzcash::SaplingPaymentAddress &zaddr) c
|
||||
for (auto t : m_op->inputs_) {
|
||||
if (t.amount >= ASSETCHAINS_TIMELOCKGTE)
|
||||
{
|
||||
m_op->builder_.SetLockTime((uint32_t)(chainActive.Height() + 1));
|
||||
m_op->builder_.AddTransparentInput(COutPoint(t.txid, t.vout), t.scriptPubKey, t.amount, 0);
|
||||
m_op->builder_.SetLockTime((uint32_t)(chainActive.Height()));
|
||||
m_op->builder_.AddTransparentInput(COutPoint(t.txid, t.vout), t.scriptPubKey, t.amount, 0xfffffffe);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -4487,7 +4487,7 @@ UniValue z_shieldcoinbase(const UniValue& params, bool fHelp)
|
||||
// (used if no Sapling addresses are involved)
|
||||
CMutableTransaction contextualTx = CreateNewContextualCMutableTransaction(
|
||||
Params().GetConsensus(), nextBlockHeight);
|
||||
contextualTx.nLockTime = nextBlockHeight;
|
||||
contextualTx.nLockTime = chainActive.LastTip()->GetHeight();
|
||||
|
||||
if (contextualTx.nVersion == 1) {
|
||||
contextualTx.nVersion = 2; // Tx format should support vjoinsplits
|
||||
|
||||
Reference in New Issue
Block a user