Skip to content

Commit ed3e5e4

Browse files
committed
[Wallet] Add global boolean whether to pay at least the custom fee (default=true)
1 parent 0ed9675 commit ed3e5e4

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/wallet.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ CFeeRate payTxFee(DEFAULT_TRANSACTION_FEE);
2929
unsigned int nTxConfirmTarget = 1;
3030
bool bSpendZeroConfChange = true;
3131
bool fSendFreeTransactions = true;
32+
bool fPayAtLeastCustomFee = true;
3233

3334
/**
3435
* Fees smaller than this (in satoshi) are considered zero fee (for transaction creation)
@@ -1383,7 +1384,10 @@ bool CWallet::CreateTransaction(const vector<pair<CScript, CAmount> >& vecSend,
13831384
{
13841385
LOCK2(cs_main, cs_wallet);
13851386
{
1386-
nFeeRet = payTxFee.GetFeePerK();
1387+
if (fPayAtLeastCustomFee)
1388+
nFeeRet = payTxFee.GetFeePerK();
1389+
else
1390+
nFeeRet = 0;
13871391
while (true)
13881392
{
13891393
txNew.vin.clear();

src/wallet.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ extern CFeeRate payTxFee;
3333
extern unsigned int nTxConfirmTarget;
3434
extern bool bSpendZeroConfChange;
3535
extern bool fSendFreeTransactions;
36+
extern bool fPayAtLeastCustomFee;
3637

3738
//! -paytxfee default
3839
static const CAmount DEFAULT_TRANSACTION_FEE = 0;

0 commit comments

Comments
 (0)