diff options
author | Cozz Lovan <cozzlovan@yahoo.com> | 2014-07-23 14:34:36 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2015-03-13 11:04:18 +0100 |
commit | 292623adf59edea52b2927b3d67fd2ff7f997882 (patch) | |
tree | afec21b4e7ff1c2b551b060f5f435895d43d15d6 /src/wallet.h | |
parent | 90a43c1e93318584d5443b513c2c0e937acb966a (diff) | |
download | bitcoin-292623adf59edea52b2927b3d67fd2ff7f997882.tar.xz |
Subtract fee from amount
Fixes #2724 and #1570.
Adds the
automatically-subtract-the-fee-from-the-amount-and-send-whats-left
feature to the GUI and RPC (sendtoaddress,sendmany).
Diffstat (limited to 'src/wallet.h')
-rw-r--r-- | src/wallet.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/wallet.h b/src/wallet.h index 6ed87d1e68..a5a2558f94 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -103,6 +103,12 @@ public: StringMap destdata; }; +struct CRecipient +{ + CScript scriptPubKey; + CAmount nAmount; + bool fSubtractFeeFromAmount; +}; typedef std::map<std::string, std::string> mapValue_t; @@ -611,10 +617,8 @@ public: CAmount GetWatchOnlyBalance() const; CAmount GetUnconfirmedWatchOnlyBalance() const; CAmount GetImmatureWatchOnlyBalance() const; - bool CreateTransaction(const std::vector<std::pair<CScript, CAmount> >& vecSend, - CWalletTx& wtxNew, CReserveKey& reservekey, CAmount& nFeeRet, std::string& strFailReason, const CCoinControl *coinControl = NULL); - bool CreateTransaction(CScript scriptPubKey, const CAmount& nValue, - CWalletTx& wtxNew, CReserveKey& reservekey, CAmount& nFeeRet, std::string& strFailReason, const CCoinControl *coinControl = NULL); + bool CreateTransaction(const std::vector<CRecipient>& vecSend, + CWalletTx& wtxNew, CReserveKey& reservekey, CAmount& nFeeRet, int& nChangePosRet, std::string& strFailReason, const CCoinControl *coinControl = NULL); bool CommitTransaction(CWalletTx& wtxNew, CReserveKey& reservekey); static CFeeRate minTxFee; |