From f179f963e89d6373672a5057dbfbdbbf105a41b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Tim=C3=B3n?= Date: Tue, 28 Feb 2017 09:48:56 +0100 Subject: [PATCH] CA: Introduce -feeasset option --- src/init.cpp | 3 +++ src/policy/policy.cpp | 2 ++ src/policy/policy.h | 4 ++++ 3 files changed, 9 insertions(+) diff --git a/src/init.cpp b/src/init.cpp index c79f7d48f8..12957ef922 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -435,6 +435,7 @@ std::string HelpMessage(HelpMessageMode mode) strUsage += HelpMessageOpt("-maxsigcachesize=", strprintf("Limit size of signature cache to MiB (default: %u)", DEFAULT_MAX_SIG_CACHE_SIZE)); strUsage += HelpMessageOpt("-maxtipage=", strprintf("Maximum tip age in seconds to consider node in initial block download (default: %u)", DEFAULT_MAX_TIP_AGE)); } + strUsage += HelpMessageOpt("-feeasset=", strprintf(_("Asset ID (hex) for mempool/relay fees (default: %s)"), DEFAULT_FEE_ASSET)); strUsage += HelpMessageOpt("-minrelaytxfee=", strprintf(_("Fees (in %s/kB) smaller than this are considered zero fee for relaying, mining and transaction creation (default: %s)"), CURRENCY_UNIT, FormatMoney(DEFAULT_MIN_RELAY_TX_FEE))); strUsage += HelpMessageOpt("-maxtxfee=", strprintf(_("Maximum total fees (in %s) to use in a single wallet transaction or raw transaction; setting this too low may abort large transactions (default: %s)"), @@ -949,6 +950,8 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) if (nConnectTimeout <= 0) nConnectTimeout = DEFAULT_CONNECT_TIMEOUT; + policyAsset = CAsset(uint256S(GetArg("-feeasset", DEFAULT_FEE_ASSET))); + // Fee-per-kilobyte amount considered the same as "free" // If you are mining, be careful setting this: // if you set it to zero then diff --git a/src/policy/policy.cpp b/src/policy/policy.cpp index 794bd52acb..fa707b35ed 100644 --- a/src/policy/policy.cpp +++ b/src/policy/policy.cpp @@ -14,6 +14,8 @@ #include +CAsset policyAsset; + /** * Check transaction inputs to mitigate two * potential denial-of-service attacks: diff --git a/src/policy/policy.h b/src/policy/policy.h index 05aee73636..0bd369ace8 100644 --- a/src/policy/policy.h +++ b/src/policy/policy.h @@ -14,6 +14,10 @@ class CCoinsViewCache; +/** The sha256 of Bitcoin genesis block, for easy reference **/ +extern CAsset policyAsset; + +static const std::string DEFAULT_FEE_ASSET = "09f663de96be771f50cab5ded00256ffe63773e2eaa9a604092951cc3d7c6621"; /** Default for -blockmaxsize, which controls the maximum size of block the mining code will create **/ static const unsigned int DEFAULT_BLOCK_MAX_SIZE = 1000000; /** Default for -blockprioritysize, maximum space for zero/low-fee transactions **/