@ -414,6 +414,8 @@ UniValue sendtoaddress(const UniValue& params, bool fHelp)
// Amount
// Amount
CAmount nAmount = AmountFromValue ( params [ 1 ] ) ;
CAmount nAmount = AmountFromValue ( params [ 1 ] ) ;
if ( nAmount < = 0 )
throw JSONRPCError ( RPC_TYPE_ERROR , " Invalid amount for send " ) ;
// Wallet comments
// Wallet comments
CWalletTx wtx ;
CWalletTx wtx ;
@ -809,6 +811,8 @@ UniValue movecmd(const UniValue& params, bool fHelp)
string strFrom = AccountFromValue ( params [ 0 ] ) ;
string strFrom = AccountFromValue ( params [ 0 ] ) ;
string strTo = AccountFromValue ( params [ 1 ] ) ;
string strTo = AccountFromValue ( params [ 1 ] ) ;
CAmount nAmount = AmountFromValue ( params [ 2 ] ) ;
CAmount nAmount = AmountFromValue ( params [ 2 ] ) ;
if ( nAmount < = 0 )
throw JSONRPCError ( RPC_TYPE_ERROR , " Invalid amount for send " ) ;
if ( params . size ( ) > 3 )
if ( params . size ( ) > 3 )
// unused parameter, used to be nMinDepth, keep type-checking it though
// unused parameter, used to be nMinDepth, keep type-checking it though
( void ) params [ 3 ] . get_int ( ) ;
( void ) params [ 3 ] . get_int ( ) ;
@ -888,6 +892,8 @@ UniValue sendfrom(const UniValue& params, bool fHelp)
if ( ! address . IsValid ( ) )
if ( ! address . IsValid ( ) )
throw JSONRPCError ( RPC_INVALID_ADDRESS_OR_KEY , " Invalid Bitcoin address " ) ;
throw JSONRPCError ( RPC_INVALID_ADDRESS_OR_KEY , " Invalid Bitcoin address " ) ;
CAmount nAmount = AmountFromValue ( params [ 2 ] ) ;
CAmount nAmount = AmountFromValue ( params [ 2 ] ) ;
if ( nAmount < = 0 )
throw JSONRPCError ( RPC_TYPE_ERROR , " Invalid amount for send " ) ;
int nMinDepth = 1 ;
int nMinDepth = 1 ;
if ( params . size ( ) > 3 )
if ( params . size ( ) > 3 )
nMinDepth = params [ 3 ] . get_int ( ) ;
nMinDepth = params [ 3 ] . get_int ( ) ;
@ -987,6 +993,8 @@ UniValue sendmany(const UniValue& params, bool fHelp)
CScript scriptPubKey = GetScriptForDestination ( address . Get ( ) ) ;
CScript scriptPubKey = GetScriptForDestination ( address . Get ( ) ) ;
CAmount nAmount = AmountFromValue ( sendTo [ name_ ] ) ;
CAmount nAmount = AmountFromValue ( sendTo [ name_ ] ) ;
if ( nAmount < = 0 )
throw JSONRPCError ( RPC_TYPE_ERROR , " Invalid amount for send " ) ;
totalAmount + = nAmount ;
totalAmount + = nAmount ;
bool fSubtractFeeFromAmount = false ;
bool fSubtractFeeFromAmount = false ;
@ -2168,9 +2176,7 @@ UniValue settxfee(const UniValue& params, bool fHelp)
LOCK2 ( cs_main , pwalletMain - > cs_wallet ) ;
LOCK2 ( cs_main , pwalletMain - > cs_wallet ) ;
// Amount
// Amount
CAmount nAmount = 0 ;
CAmount nAmount = AmountFromValue ( params [ 0 ] ) ;
if ( params [ 0 ] . get_real ( ) ! = 0.0 )
nAmount = AmountFromValue ( params [ 0 ] ) ; // rejects 0.0 amounts
payTxFee = CFeeRate ( nAmount , 1000 ) ;
payTxFee = CFeeRate ( nAmount , 1000 ) ;
return true ;
return true ;
@ -2352,4 +2358,4 @@ UniValue listunspent(const UniValue& params, bool fHelp)
}
}
return results ;
return results ;
}
}