aboutsummaryrefslogtreecommitdiff
path: root/src/main.h
diff options
context:
space:
mode:
authorGavin Andresen <[email protected]>2011-12-20 13:09:18 -0800
committerGavin Andresen <[email protected]>2011-12-20 13:09:18 -0800
commit781c06c0f534913321a415a4fb64a60734e43101 (patch)
treef2d96b0c74da35b701513a629817c7e944798827 /src/main.h
parentMerge branch 'op_eval' (diff)
parentGetMinFee takes a mode parameter (GMF_{BLOCK,RELAY,SEND}) instead of fForRelay (diff)
downloaddiscoin-781c06c0f534913321a415a4fb64a60734e43101.tar.xz
discoin-781c06c0f534913321a415a4fb64a60734e43101.zip
Merge pull request #677 from luke-jr/minfee_modes
API: GetMinFee modes
Diffstat (limited to 'src/main.h')
-rw-r--r--src/main.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/main.h b/src/main.h
index 4543065d7..d613d284b 100644
--- a/src/main.h
+++ b/src/main.h
@@ -393,6 +393,13 @@ public:
+enum GetMinFee_mode
+{
+ GMF_BLOCK,
+ GMF_RELAY,
+ GMF_SEND,
+};
+
//
// The basic transaction that is broadcasted on the network and contained in
// blocks. A transaction can contain multiple inputs and outputs.
@@ -515,10 +522,10 @@ public:
return dPriority > COIN * 144 / 250;
}
- int64 GetMinFee(unsigned int nBlockSize=1, bool fAllowFree=true, bool fForRelay=false) const
+ int64 GetMinFee(unsigned int nBlockSize=1, bool fAllowFree=true, enum GetMinFee_mode mode=GMF_BLOCK) const
{
// Base fee is either MIN_TX_FEE or MIN_RELAY_TX_FEE
- int64 nBaseFee = fForRelay ? MIN_RELAY_TX_FEE : MIN_TX_FEE;
+ int64 nBaseFee = (mode == GMF_RELAY) ? MIN_RELAY_TX_FEE : MIN_TX_FEE;
unsigned int nBytes = ::GetSerializeSize(*this, SER_NETWORK);
unsigned int nNewBlockSize = nBlockSize + nBytes;