aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet.h
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2015-09-13 23:23:59 +0200
committerMarcoFalke <falke.marco@gmail.com>2015-10-28 10:52:46 +0100
commit6b0e622c25ddba656149de0f9f8b7f2a0aa0deba (patch)
tree5e4f6bc4931e4d687174c742ec5cb3112755b261 /src/wallet/wallet.h
parent0143a1f228c3447ae2e025c697b0ad53a0d8d306 (diff)
downloadbitcoin-6b0e622c25ddba656149de0f9f8b7f2a0aa0deba.tar.xz
[wallet] Refactor to use new MIN_CHANGE
* Introduce new constant MIN_CHANGE and use it instead of the hardcoded "CENT" * Add test case for MIN_CHANGE * Introduce new constant for -mintxfee default: DEFAULT_TRANSACTION_MINFEE = 1000
Diffstat (limited to 'src/wallet/wallet.h')
-rw-r--r--src/wallet/wallet.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h
index bd30b67b09..143ca22bdc 100644
--- a/src/wallet/wallet.h
+++ b/src/wallet/wallet.h
@@ -41,8 +41,12 @@ extern bool fPayAtLeastCustomFee;
static const CAmount DEFAULT_TRANSACTION_FEE = 0;
//! -paytxfee will warn if called with a higher fee than this amount (in satoshis) per KB
static const CAmount nHighTransactionFeeWarning = 0.01 * COIN;
+//! -mintxfee default
+static const CAmount DEFAULT_TRANSACTION_MINFEE = 1000;
//! -maxtxfee default
static const CAmount DEFAULT_TRANSACTION_MAXFEE = 0.1 * COIN;
+//! minimum change amount
+static const CAmount MIN_CHANGE = CENT;
//! -txconfirmtarget default
static const unsigned int DEFAULT_TX_CONFIRM_TARGET = 2;
//! -maxtxfee will warn if called with a higher fee than this amount (in satoshis)
@@ -544,7 +548,14 @@ public:
//! check whether we are allowed to upgrade (or already support) to the named feature
bool CanSupportFeature(enum WalletFeature wf) { AssertLockHeld(cs_wallet); return nWalletMaxVersion >= wf; }
+ /**
+ * populate vCoins with vector of available COutputs.
+ */
void AvailableCoins(std::vector<COutput>& vCoins, bool fOnlyConfirmed=true, const CCoinControl *coinControl = NULL, bool fIncludeZeroValue=false) const;
+ /**
+ * Select coins until nTargetValue is reached. Return the actual value
+ * and the corresponding coin set.
+ */
bool SelectCoinsMinConf(const CAmount& nTargetValue, int nConfMine, int nConfTheirs, std::vector<COutput> vCoins, std::set<std::pair<const CWalletTx*,unsigned int> >& setCoinsRet, CAmount& nValueRet) const;
bool IsSpent(const uint256& hash, unsigned int n) const;