Don't log mempool error for staking tx, fix default destination for staking tx
This commit is contained in:
@@ -1575,8 +1575,7 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa
|
|||||||
CStakeParams p;
|
CStakeParams p;
|
||||||
if (ValidateStakeTransaction(tx, p, false))
|
if (ValidateStakeTransaction(tx, p, false))
|
||||||
{
|
{
|
||||||
return state.DoS(0, error("AcceptToMemoryPool: attempt to add staking transaction to the mempool"),
|
return state.DoS(0, false, REJECT_INVALID, "staking");
|
||||||
REJECT_INVALID, "staking");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// is it already in the memory pool?
|
// is it already in the memory pool?
|
||||||
|
|||||||
@@ -825,17 +825,20 @@ CBlockTemplate* CreateNewBlockWithKey(CReserveKey& reservekey, int32_t nHeight,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!reservekey.GetReservedKey(pubkey))
|
if (!isStake)
|
||||||
{
|
{
|
||||||
return NULL;
|
if (!reservekey.GetReservedKey(pubkey))
|
||||||
|
{
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
scriptPubKey.resize(35);
|
||||||
|
ptr = (uint8_t *)pubkey.begin();
|
||||||
|
scriptPubKey[0] = 33;
|
||||||
|
for (i=0; i<33; i++)
|
||||||
|
scriptPubKey[i+1] = ptr[i];
|
||||||
|
scriptPubKey[34] = OP_CHECKSIG;
|
||||||
|
//scriptPubKey = CScript() << ToByteVector(pubkey) << OP_CHECKSIG;
|
||||||
}
|
}
|
||||||
scriptPubKey.resize(35);
|
|
||||||
ptr = (uint8_t *)pubkey.begin();
|
|
||||||
scriptPubKey[0] = 33;
|
|
||||||
for (i=0; i<33; i++)
|
|
||||||
scriptPubKey[i+1] = ptr[i];
|
|
||||||
scriptPubKey[34] = OP_CHECKSIG;
|
|
||||||
//scriptPubKey = CScript() << ToByteVector(pubkey) << OP_CHECKSIG;
|
|
||||||
}
|
}
|
||||||
return CreateNewBlock(scriptPubKey, gpucount, isStake);
|
return CreateNewBlock(scriptPubKey, gpucount, isStake);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1397,7 +1397,7 @@ int32_t CWallet::VerusStakeTransaction(CBlock *pBlock, CMutableTransaction &txNe
|
|||||||
const CKeyStore& keystore = *pwalletMain;
|
const CKeyStore& keystore = *pwalletMain;
|
||||||
txNew.vin.resize(1);
|
txNew.vin.resize(1);
|
||||||
txNew.vout.resize(1);
|
txNew.vout.resize(1);
|
||||||
txfee = extendedStake ? DEFAULT_STAKE_TXFEE : 0; // extended stakes will always be rebroadcast, so they require a fee to make it fast
|
txfee = extendedStake ? DEFAULT_STAKE_TXFEE : 0;
|
||||||
txNew.vin[0].prevout.hash = stakeSource.GetHash();
|
txNew.vin[0].prevout.hash = stakeSource.GetHash();
|
||||||
txNew.vin[0].prevout.n = voutNum;
|
txNew.vin[0].prevout.n = voutNum;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user