// Amount
int64 nAmount = AmountFromValue(params[1]);
+ if (nAmount < MIN_TXOUT_AMOUNT)
+ throw JSONRPCError(-101, "Send amount too small");
// Wallet comments
CWalletTx wtx;
if (!address.IsValid())
throw JSONRPCError(-5, "Invalid ppcoin address");
int64 nAmount = AmountFromValue(params[2]);
+ if (nAmount < MIN_TXOUT_AMOUNT)
+ throw JSONRPCError(-101, "Send amount too small");
int nMinDepth = 1;
if (params.size() > 3)
nMinDepth = params[3].get_int();
CScript scriptPubKey;
scriptPubKey.SetBitcoinAddress(address);
int64 nAmount = AmountFromValue(s.value_);
+ if (nAmount < MIN_TXOUT_AMOUNT)
+ throw JSONRPCError(-101, "Send amount too small");
totalAmount += nAmount;
vecSend.push_back(make_pair(scriptPubKey, nAmount));
if (pwalletMain->IsLocked())
throw JSONRPCError(-13, "Error: Please enter the wallet passphrase with walletpassphrase first.");
- if (fWalletUnlockStakeOnly)
- throw JSONRPCError(-13, "Error: Wallet unlocked for coinstake only.");
+ if (fWalletUnlockMintOnly)
+ throw JSONRPCError(-13, "Error: Wallet unlocked for block minting only.");
// Check funds
int64 nBalance = GetAccountBalance(strAccount, nMinDepth);
{
if (pwalletMain->IsCrypted() && (fHelp || params.size() < 2 || params.size() > 3))
throw runtime_error(
- "walletpassphrase <passphrase> <timeout> [stakeonly]\n"
+ "walletpassphrase <passphrase> <timeout> [mintonly]\n"
"Stores the wallet decryption key in memory for <timeout> seconds.\n"
- "stakeonly is optional true/false allowing only stake creation.");
+ "mintonly is optional true/false allowing only block minting.");
if (fHelp)
return true;
if (!pwalletMain->IsCrypted())
// ppcoin: if user OS account compromised prevent trivial sendmoney commands
if (params.size() > 2)
- fWalletUnlockStakeOnly = params[2].get_bool();
+ fWalletUnlockMintOnly = params[2].get_bool();
else
- fWalletUnlockStakeOnly = false;
+ fWalletUnlockMintOnly = false;
return Value::null;
}
nStart = GetTime();
// Create new block
- pblock = CreateNewBlock(pwalletMain, true);
+ pblock = CreateNewBlock(pwalletMain);
if (!pblock)
throw JSONRPCError(-7, "Out of memory");
vNewBlock.push_back(pblock);
pblock->vtx[0].vin[0].scriptSig = mapNewBlock[pdata->hashMerkleRoot].second;
pblock->hashMerkleRoot = pblock->BuildMerkleTree();
if (!pblock->SignBlock(*pwalletMain))
- throw JSONRPCError(-100, "Unable to sign block");
+ throw JSONRPCError(-100, "Unable to sign block, wallet locked?");
return CheckWork(pblock, *pwalletMain, reservekey);
}