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).
This commit is contained in:
committed by
Wladimir J. van der Laan
parent
90a43c1e93
commit
292623adf5
12
src/wallet.h
12
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;
|
||||
|
||||
Reference in New Issue
Block a user