Merge bitcoin v0.5.1 into ppcoin
[novacoin.git] / src / bitcoinrpc.cpp
index bb8d8e2..3ff5c60 100644 (file)
@@ -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 <amount>\n"
-            "<amount> is a real and is rounded to the nearest 0.00000001");
+            "<amount> 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;