Skip to content

Commit 0ed9675

Browse files
committed
[Wallet] Add global boolean whether to send free transactions (default=true)
1 parent 8c41853 commit 0ed9675

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/wallet.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ using namespace std;
2828
CFeeRate payTxFee(DEFAULT_TRANSACTION_FEE);
2929
unsigned int nTxConfirmTarget = 1;
3030
bool bSpendZeroConfChange = true;
31+
bool fSendFreeTransactions = true;
3132

3233
/**
3334
* Fees smaller than this (in satoshi) are considered zero fee (for transaction creation)
@@ -1502,7 +1503,7 @@ bool CWallet::CreateTransaction(const vector<pair<CScript, CAmount> >& vecSend,
15021503
break; // Done, enough fee included.
15031504

15041505
// Too big to send for free? Include more fee and try again:
1505-
if (nBytes > MAX_FREE_TRANSACTION_CREATE_SIZE)
1506+
if (!fSendFreeTransactions || nBytes > MAX_FREE_TRANSACTION_CREATE_SIZE)
15061507
{
15071508
nFeeRet = nFeeNeeded;
15081509
continue;

src/wallet.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
extern CFeeRate payTxFee;
3333
extern unsigned int nTxConfirmTarget;
3434
extern bool bSpendZeroConfChange;
35+
extern bool fSendFreeTransactions;
3536

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

0 commit comments

Comments
 (0)