Merge pull request #129 from jtimon/0.13.1-elements-fixup-sendmoney

Trivial: Move SendMoney wrapper below funcion definition
This commit is contained in:
Gregory Sanders 2017-02-23 19:17:33 -05:00 committed by GitHub
commit 160c4a13e9

View file

@ -344,12 +344,6 @@ UniValue getaddressesbyaccount(const UniValue& params, bool fHelp)
return ret;
}
static void SendMoney(const CScript& scriptPubKey, CAmount nValue, bool fSubtractFeeFromAmount, const CPubKey &confidentiality_key, CWalletTx& wtxNew);
static void SendMoney(const CTxDestination &address, CAmount nValue, bool fSubtractFeeFromAmount, const CPubKey &confidentiality_key, CWalletTx& wtxNew)
{
SendMoney(GetScriptForDestination(address), nValue, fSubtractFeeFromAmount, confidentiality_key, wtxNew);
}
static void SendMoney(const CScript& scriptPubKey, CAmount nValue, bool fSubtractFeeFromAmount, const CPubKey &confidentiality_key, CWalletTx& wtxNew)
{
CAmount curBalance = pwalletMain->GetBalance();
@ -378,6 +372,11 @@ static void SendMoney(const CScript& scriptPubKey, CAmount nValue, bool fSubtrac
throw JSONRPCError(RPC_WALLET_ERROR, "Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of the wallet and coins were spent in the copy but not marked as spent here.");
}
static void SendMoney(const CTxDestination &address, CAmount nValue, bool fSubtractFeeFromAmount, const CPubKey &confidentiality_key, CWalletTx& wtxNew)
{
SendMoney(GetScriptForDestination(address), nValue, fSubtractFeeFromAmount, confidentiality_key, wtxNew);
}
UniValue sendtoaddress(const UniValue& params, bool fHelp)
{
if (!EnsureWalletIsAvailable(fHelp))