Skip to content

Commit

Permalink
Fees (#15): Default fees set to 0.001 GLD. Since this was the same as…
Browse files Browse the repository at this point in the history
… Litecoin 0.14.2, returned other values to Litecoin values, except for fall back fee.
  • Loading branch information
Stouse49 committed Jan 2, 2018
1 parent 28c5087 commit 2fe87c5
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/policy/policy.h
Expand Up @@ -22,7 +22,7 @@ static const unsigned int DEFAULT_BLOCK_MAX_SIZE = 2000000;
/** Default for -blockprioritysize, maximum space for zero/low-fee transactions **/
static const unsigned int DEFAULT_BLOCK_PRIORITY_SIZE = 0;
/** Default for -blockmintxfee, which sets the minimum feerate for a transaction in blocks created by mining code **/
static const unsigned int DEFAULT_BLOCK_MIN_TX_FEE = 1000000;
static const unsigned int DEFAULT_BLOCK_MIN_TX_FEE = 1000;
/** The maximum weight (size in bytes) for transactions we're willing to relay/mine */
static const unsigned int MAX_STANDARD_TX_WEIGHT = 100000;
/** Maximum number of signature check operations in an IsStandard() P2SH script */
Expand Down
22 changes: 11 additions & 11 deletions src/test/miner_tests.cpp
Expand Up @@ -93,22 +93,22 @@ void TestPackageSelection(const CChainParams& chainparams, CScript scriptPubKey,
tx.vin[0].prevout.hash = txFirst[0]->GetHash();
tx.vin[0].prevout.n = 0;
tx.vout.resize(1);
tx.vout[0].nValue = 1000000000000LL - 1000000;
tx.vout[0].nValue = 1000000000000LL - 1000;
// This tx has a low fee: 1000 satoshis
uint256 hashParentTx = tx.GetHash(); // save this txid for later use
mempool.addUnchecked(hashParentTx, entry.Fee(1000000).Time(GetTime()).SpendsCoinbase(true).FromTx(tx));
mempool.addUnchecked(hashParentTx, entry.Fee(1000).Time(GetTime()).SpendsCoinbase(true).FromTx(tx));

// This tx has a medium fee: 10000 satoshis
tx.vin[0].prevout.hash = txFirst[1]->GetHash();
tx.vout[0].nValue = 1000000000000LL - 10000000;
tx.vout[0].nValue = 1000000000000LL - 10000;
uint256 hashMediumFeeTx = tx.GetHash();
mempool.addUnchecked(hashMediumFeeTx, entry.Fee(10000000).Time(GetTime()).SpendsCoinbase(true).FromTx(tx));
mempool.addUnchecked(hashMediumFeeTx, entry.Fee(10000).Time(GetTime()).SpendsCoinbase(true).FromTx(tx));

// This tx has a high fee, but depends on the first transaction
tx.vin[0].prevout.hash = hashParentTx;
tx.vout[0].nValue = 1000000000000LL - 1000000 - 50000000; // 50k satoshi fee
tx.vout[0].nValue = 1000000000000LL - 1000 - 50000; // 50k satoshi fee
uint256 hashHighFeeTx = tx.GetHash();
mempool.addUnchecked(hashHighFeeTx, entry.Fee(50000000).Time(GetTime()).SpendsCoinbase(false).FromTx(tx));
mempool.addUnchecked(hashHighFeeTx, entry.Fee(50000).Time(GetTime()).SpendsCoinbase(false).FromTx(tx));

std::unique_ptr<CBlockTemplate> pblocktemplate = BlockAssembler(chainparams).CreateNewBlock(scriptPubKey);
BOOST_CHECK(pblocktemplate->block.vtx[1]->GetHash() == hashParentTx);
Expand All @@ -117,7 +117,7 @@ void TestPackageSelection(const CChainParams& chainparams, CScript scriptPubKey,

// Test that a package below the block min tx fee doesn't get included
tx.vin[0].prevout.hash = hashHighFeeTx;
tx.vout[0].nValue = 1000000000000LL - 1000000 - 50000000; // 0 fee
tx.vout[0].nValue = 1000000000000LL - 1000 - 50000000; // 0 fee
uint256 hashFreeTx = tx.GetHash();
mempool.addUnchecked(hashFreeTx, entry.Fee(0).FromTx(tx));
size_t freeTxSize = ::GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION);
Expand All @@ -127,7 +127,7 @@ void TestPackageSelection(const CChainParams& chainparams, CScript scriptPubKey,
CAmount feeToUse = blockMinFeeRate.GetFee(2*freeTxSize) - 1;

tx.vin[0].prevout.hash = hashFreeTx;
tx.vout[0].nValue = 1000000000000LL - 1000000 - 50000000 - feeToUse;
tx.vout[0].nValue = 1000000000000LL - 1000 - 50000000 - feeToUse;
uint256 hashLowFeeTx = tx.GetHash();
mempool.addUnchecked(hashLowFeeTx, entry.Fee(feeToUse).FromTx(tx));
pblocktemplate = BlockAssembler(chainparams).CreateNewBlock(scriptPubKey);
Expand Down Expand Up @@ -176,8 +176,8 @@ void TestPackageSelection(const CChainParams& chainparams, CScript scriptPubKey,
// This tx will be mineable, and should cause hashLowFeeTx2 to be selected
// as well.
tx.vin[0].prevout.n = 1;
tx.vout[0].nValue = 100000000 - 10000000; // 10k satoshi fee
mempool.addUnchecked(tx.GetHash(), entry.Fee(10000000).FromTx(tx));
tx.vout[0].nValue = 100000000 - 10000; // 10k satoshi fee
mempool.addUnchecked(tx.GetHash(), entry.Fee(10000).FromTx(tx));
pblocktemplate = BlockAssembler(chainparams).CreateNewBlock(scriptPubKey);
BOOST_CHECK(pblocktemplate->block.vtx[8]->GetHash() == hashLowFeeTx2);
}
Expand Down Expand Up @@ -234,7 +234,7 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity)
BOOST_CHECK(pblocktemplate = BlockAssembler(chainparams).CreateNewBlock(scriptPubKey));

const CAmount BLOCKSUBSIDY = 10000*COIN;
const CAmount LOWFEE = CENT*50;
const CAmount LOWFEE = CENT;
const CAmount HIGHFEE = COIN;
const CAmount HIGHERFEE = 4*COIN;

Expand Down
6 changes: 3 additions & 3 deletions src/validation.h
Expand Up @@ -58,11 +58,11 @@ static const bool DEFAULT_WHITELISTRELAY = true;
/** Default for DEFAULT_WHITELISTFORCERELAY. */
static const bool DEFAULT_WHITELISTFORCERELAY = true;
/** Default for -minrelaytxfee, minimum relay fee for transactions */
static const unsigned int DEFAULT_MIN_RELAY_TX_FEE = 1000000;
static const unsigned int DEFAULT_MIN_RELAY_TX_FEE = 100000;
//! -maxtxfee default
static const CAmount DEFAULT_TRANSACTION_MAXFEE = 1.0 * COIN; // 100 times default fee
static const CAmount DEFAULT_TRANSACTION_MAXFEE = 0.1 * COIN; // 100 times default fee
//! Discourage users to set fees higher than this amount (in satoshis) per kB
static const CAmount HIGH_TX_FEE_PER_KB = 10.0 * COIN;
static const CAmount HIGH_TX_FEE_PER_KB = 0.01 * COIN;
//! -maxtxfee will warn if called with a higher fee than this amount (in satoshis)
static const CAmount HIGH_MAX_TX_FEE = 100 * HIGH_TX_FEE_PER_KB;
/** Default for -limitancestorcount, max number of in-mempool ancestors */
Expand Down
4 changes: 2 additions & 2 deletions src/wallet/wallet.h
Expand Up @@ -49,11 +49,11 @@ static const unsigned int DEFAULT_KEYPOOL_SIZE = 100;
//! -paytxfee default
static const CAmount DEFAULT_TRANSACTION_FEE = 0;
//! -fallbackfee default
static const CAmount DEFAULT_FALLBACK_FEE = 2000000;
static const CAmount DEFAULT_FALLBACK_FEE = 100000;
//! -mintxfee default
static const CAmount DEFAULT_TRANSACTION_MINFEE = 100000;
//! minimum recommended increment for BIP 125 replacement txs
static const CAmount WALLET_INCREMENTAL_RELAY_FEE = 100000;
static const CAmount WALLET_INCREMENTAL_RELAY_FEE = 5000;
//! target minimum change amount
static const CAmount MIN_CHANGE = CENT;
//! final minimum change amount after paying for fees
Expand Down

0 comments on commit 2fe87c5

Please sign in to comment.