aboutsummaryrefslogtreecommitdiff
path: root/src/wallet.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <[email protected]>2014-12-10 08:18:41 +0100
committerWladimir J. van der Laan <[email protected]>2014-12-10 08:22:20 +0100
commit34468066ff54881eedd06e9aca39c3aa455cfe7c (patch)
tree9c41ff54a95aa907349248c342da35c6ac6826b5 /src/wallet.cpp
parentMerge pull request #5395 (diff)
parentUse RPC_INVALID_PARAMETER instead of RPC_WALLET_ERROR for invalid amount. (diff)
downloaddiscoin-34468066ff54881eedd06e9aca39c3aa455cfe7c.tar.xz
discoin-34468066ff54881eedd06e9aca39c3aa455cfe7c.zip
Merge pull request #5399
4be639e Use RPC_INVALID_PARAMETER instead of RPC_WALLET_ERROR for invalid amount. No return at the end of void function. (Pavel Janík) b93173d Move SendMoney() to rpcwallet.cpp. (Pavel Janík)
Diffstat (limited to 'src/wallet.cpp')
-rw-r--r--src/wallet.cpp40
1 files changed, 0 insertions, 40 deletions
diff --git a/src/wallet.cpp b/src/wallet.cpp
index 27dbf61c2..32a64daac 100644
--- a/src/wallet.cpp
+++ b/src/wallet.cpp
@@ -1587,46 +1587,6 @@ bool CWallet::CommitTransaction(CWalletTx& wtxNew, CReserveKey& reservekey)
return true;
}
-
-
-
-string CWallet::SendMoney(const CTxDestination &address, CAmount nValue, CWalletTx& wtxNew)
-{
- // Check amount
- if (nValue <= 0)
- return _("Invalid amount");
- if (nValue > GetBalance())
- return _("Insufficient funds");
-
- string strError;
- if (IsLocked())
- {
- strError = _("Error: Wallet locked, unable to create transaction!");
- LogPrintf("SendMoney() : %s", strError);
- return strError;
- }
-
- // Parse Bitcoin address
- CScript scriptPubKey = GetScriptForDestination(address);
-
- // Create and send the transaction
- CReserveKey reservekey(this);
- CAmount nFeeRequired;
- if (!CreateTransaction(scriptPubKey, nValue, wtxNew, reservekey, nFeeRequired, strError))
- {
- if (nValue + nFeeRequired > GetBalance())
- strError = strprintf(_("Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds!"), FormatMoney(nFeeRequired));
- LogPrintf("SendMoney() : %s\n", strError);
- return strError;
- }
- if (!CommitTransaction(wtxNew, reservekey))
- return _("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 wallet.dat and coins were spent in the copy but not marked as spent here.");
-
- return "";
-}
-
-
-
CAmount CWallet::GetMinimumFee(unsigned int nTxBytes, unsigned int nConfirmTarget, const CTxMemPool& pool)
{
// payTxFee is user-set "I want to pay this much"