diff options
| author | Wladimir J. van der Laan <[email protected]> | 2013-12-13 16:06:32 +0100 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2013-12-13 16:06:32 +0100 |
| commit | a943bde6f067567e47c6e12b16c541bb1fea575a (patch) | |
| tree | 1b553547b8c2b02bbde4f5fafb47a5d6e15a6233 /src/rpcwallet.cpp | |
| parent | Move `getinfo` from rpcnet to rpcmisc (diff) | |
| download | discoin-a943bde6f067567e47c6e12b16c541bb1fea575a.tar.xz discoin-a943bde6f067567e47c6e12b16c541bb1fea575a.zip | |
Move `settxfee` from rpcblockchain to rpcwallet
`settxfee` only affects the wallet, not the block chain.
Diffstat (limited to 'src/rpcwallet.cpp')
| -rw-r--r-- | src/rpcwallet.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp index 82fa9d88c..a2a12c824 100644 --- a/src/rpcwallet.cpp +++ b/src/rpcwallet.cpp @@ -2066,3 +2066,28 @@ Value listlockunspent(const Array& params, bool fHelp) return ret; } +Value settxfee(const Array& params, bool fHelp) +{ + if (fHelp || params.size() < 1 || params.size() > 1) + throw runtime_error( + "settxfee amount\n" + "\nSet the transaction fee. 'amount' is a real and is rounded to the nearest 0.00000001\n" + "\nArguments:\n" + "1. amount (numeric, required) The transaction fee in btc rounded to the nearest 0.00000001\n" + "\nResult\n" + "true|false (boolean) Returns true if successful\n" + "\nExamples:\n" + + HelpExampleCli("settxfee", "0.00001") + + HelpExampleRpc("settxfee", "0.00001") + ); + + // Amount + int64_t nAmount = 0; + if (params[0].get_real() != 0.0) + nAmount = AmountFromValue(params[0]); // rejects 0.0 amounts + + nTransactionFee = nAmount; + return true; +} + + |