Skip to content

Commit

Permalink
Subtract fee from amount: CAmount
Browse files Browse the repository at this point in the history
  • Loading branch information
cozz committed Oct 3, 2014
1 parent f156d37 commit 55e774d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ class CTxOut

uint256 GetHash() const;

int64_t GetDustThreshold(CFeeRate& minRelayTxFee) const
CAmount GetDustThreshold(CFeeRate& minRelayTxFee) const
{
// "Dust" is defined in terms of CTransaction::minRelayTxFee,
// which has units satoshis-per-kilobyte.
Expand Down
2 changes: 1 addition & 1 deletion src/qt/walletmodeltransaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ void WalletModelTransaction::reassignAmounts(int nChangePosRet)

if (rcp.paymentRequest.IsInitialized())
{
int64_t subtotal = 0;
CAmount subtotal = 0;
const payments::PaymentDetails& details = rcp.paymentRequest.getDetails();
for (int j = 0; j < details.outputs_size(); j++)
{
Expand Down
2 changes: 1 addition & 1 deletion src/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1440,7 +1440,7 @@ bool CWallet::CreateTransaction(const vector<CRecipient>& vecSend,
// So instead we raise the change and deduct from the recipient.
if (nSubtractFeeFromAmount > 0 && newTxOut.IsDust(::minRelayTxFee))
{
int64_t nDust = newTxOut.GetDustThreshold(::minRelayTxFee) - newTxOut.nValue;
CAmount nDust = newTxOut.GetDustThreshold(::minRelayTxFee) - newTxOut.nValue;
newTxOut.nValue += nDust; // raise change until no more dust
for (unsigned int i = 0; i < vecSend.size(); i++) // subtract from first recipient
{
Expand Down
2 changes: 1 addition & 1 deletion src/wallet.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class CAddressBookData
struct CRecipient
{
CScript scriptPubKey;
int64_t nAmount;
CAmount nAmount;
bool fSubtractFeeFromAmount;
};

Expand Down

0 comments on commit 55e774d

Please sign in to comment.