X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Fbitcoinrpc.cpp;h=3ff5c601d11b2664bdf0200a5b99e6f0c69ecb97;hb=de71734ac41eebfe8763ce34e0443d64ea4aacc9;hp=bb8d8e2d7734f1a13566d935a58d48f213eb9986;hpb=b12fc3e11223557855bb2394e1097afbf0de0b79;p=novacoin.git diff --git a/src/bitcoinrpc.cpp b/src/bitcoinrpc.cpp index bb8d8e2..3ff5c60 100644 --- a/src/bitcoinrpc.cpp +++ b/src/bitcoinrpc.cpp @@ -72,7 +72,7 @@ void PrintConsole(const std::string &format, ...) int64 AmountFromValue(const Value& value) { double dAmount = value.get_real(); - if (dAmount <= 0.0 || dAmount > 21000000.0) + if (dAmount <= 0.0 || dAmount > MAX_MONEY) throw JSONRPCError(-3, "Invalid amount"); int64 nAmount = roundint64(dAmount * COIN); if (!MoneyRange(nAmount)) @@ -485,12 +485,13 @@ Value settxfee(const Array& params, bool fHelp) if (fHelp || params.size() < 1 || params.size() > 1) throw runtime_error( "settxfee \n" - " is a real and is rounded to the nearest 0.00000001"); + " is a real and is rounded to the nearest 0.0001\n" + "Minimum and default transaction fee is 1 coin"); // Amount - int64 nAmount = 0; - if (params[0].get_real() != 0.0) - nAmount = AmountFromValue(params[0]); // rejects 0.0 amounts + int64 nAmount = MIN_TX_FEE; + if (params[0].get_real() != 0.0) // rejects 0.0 amounts + nAmount = max(nAmount, AmountFromValue(params[0])); nTransactionFee = nAmount; return true;