X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Fbitcoinrpc.cpp;h=2ea5415c67031a7d7e9e2875c046c6915b5ec886;hb=8bb29178006eafab89b9c2106bdcd0dd75f21b94;hp=b2ff091ddf7a633094d0c0e6930727f5c84c2a58;hpb=3a59ce084de0266c56df1e9ffb2fcd38e0ca4ccd;p=novacoin.git diff --git a/src/bitcoinrpc.cpp b/src/bitcoinrpc.cpp index b2ff091..2ea5415 100644 --- a/src/bitcoinrpc.cpp +++ b/src/bitcoinrpc.cpp @@ -569,6 +569,8 @@ Value sendtoaddress(const Array& params, bool fHelp) // Amount int64 nAmount = AmountFromValue(params[1]); + if (nAmount < MIN_TXOUT_AMOUNT) + throw JSONRPCError(-101, "Send amount too small"); // Wallet comments CWalletTx wtx; @@ -891,6 +893,8 @@ Value sendfrom(const Array& params, bool fHelp) 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(); @@ -959,6 +963,8 @@ Value sendmany(const Array& params, bool fHelp) 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)); @@ -1826,7 +1832,7 @@ Value getwork(const Array& params, bool fHelp) nStart = GetTime(); // Create new block - pblock = CreateNewBlock(pwalletMain, true); + pblock = CreateNewBlock(pwalletMain); if (!pblock) throw JSONRPCError(-7, "Out of memory"); vNewBlock.push_back(pblock);