Browse Source

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

pull/4/head
miketout 6 years ago
parent
commit
f1f6dfbb85
  1. 3
      src/main.cpp
  2. 21
      src/miner.cpp
  3. 2
      src/wallet/wallet.cpp

3
src/main.cpp

@ -1575,8 +1575,7 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa
CStakeParams p;
if (ValidateStakeTransaction(tx, p, false))
{
return state.DoS(0, error("AcceptToMemoryPool: attempt to add staking transaction to the mempool"),
REJECT_INVALID, "staking");
return state.DoS(0, false, REJECT_INVALID, "staking");
}
// is it already in the memory pool?

21
src/miner.cpp

@ -825,17 +825,20 @@ CBlockTemplate* CreateNewBlockWithKey(CReserveKey& reservekey, int32_t nHeight,
}
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);
}

2
src/wallet/wallet.cpp

@ -1397,7 +1397,7 @@ int32_t CWallet::VerusStakeTransaction(CBlock *pBlock, CMutableTransaction &txNe
const CKeyStore& keystore = *pwalletMain;
txNew.vin.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.n = voutNum;

Loading…
Cancel
Save