瀏覽代碼

[Wallet] Add global boolean whether to send free transactions (default=true)

tags/v0.15.1
Cozz Lovan 5 年之前
父節點
當前提交
0ed9675be4
共有 2 個文件被更改,包括 3 次插入1 次删除
  1. 2
    1
      src/wallet.cpp
  2. 1
    0
      src/wallet.h

+ 2
- 1
src/wallet.cpp 查看文件

@@ -28,6 +28,7 @@ using namespace std;
CFeeRate payTxFee(DEFAULT_TRANSACTION_FEE);
unsigned int nTxConfirmTarget = 1;
bool bSpendZeroConfChange = true;
bool fSendFreeTransactions = true;

/**
* 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,
break; // Done, enough fee included.

// Too big to send for free? Include more fee and try again:
if (nBytes > MAX_FREE_TRANSACTION_CREATE_SIZE)
if (!fSendFreeTransactions || nBytes > MAX_FREE_TRANSACTION_CREATE_SIZE)
{
nFeeRet = nFeeNeeded;
continue;

+ 1
- 0
src/wallet.h 查看文件

@@ -32,6 +32,7 @@
extern CFeeRate payTxFee;
extern unsigned int nTxConfirmTarget;
extern bool bSpendZeroConfChange;
extern bool fSendFreeTransactions;

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

Loading…
取消
儲存