Don't log mempool error for staking tx, fix default destination for staking tx

This commit is contained in:
miketout
2018-11-01 13:40:51 -07:00
parent 4ac64cd2a0
commit f1f6dfbb85
3 changed files with 14 additions and 12 deletions

View File

@@ -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?

View File

@@ -824,6 +824,8 @@ CBlockTemplate* CreateNewBlockWithKey(CReserveKey& reservekey, int32_t nHeight,
scriptPubKey = CScript() << ParseHex(NOTARY_PUBKEY) << OP_CHECKSIG; scriptPubKey = CScript() << ParseHex(NOTARY_PUBKEY) << OP_CHECKSIG;
} }
else else
{
if (!isStake)
{ {
if (!reservekey.GetReservedKey(pubkey)) if (!reservekey.GetReservedKey(pubkey))
{ {
@@ -837,6 +839,7 @@ CBlockTemplate* CreateNewBlockWithKey(CReserveKey& reservekey, int32_t nHeight,
scriptPubKey[34] = OP_CHECKSIG; scriptPubKey[34] = OP_CHECKSIG;
//scriptPubKey = CScript() << ToByteVector(pubkey) << OP_CHECKSIG; //scriptPubKey = CScript() << ToByteVector(pubkey) << OP_CHECKSIG;
} }
}
return CreateNewBlock(scriptPubKey, gpucount, isStake); return CreateNewBlock(scriptPubKey, gpucount, isStake);
} }

View File

@@ -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;