mastercoin-MSC/mastercore — pull request #110 by dexX7 (2014-09-03 22:15:06+00:00)
Title: Mcore floating output amounts

Replaces #66 with an up-to-date version.

---

1. `GetDustLimit(const CScript&)` is used instead of `MP_DUST_LIMIT`. See 426592e for additional details.

2. `nMinRelayTxFee` was set to 1001 which results in output amounts of:
- 552 (pay-to-pubkey-hash)
- 685 (multisig, two compressed public keys)
- 781 (multisig, one uncompressed, one compressed public key)
- 787 (multisig, three compressed public keys)
- 883 (multisig, one uncompressed, two compressed public keys)

Set this value to 10000 to mirror the old "6000 / packet rule" with slightly tighter (and more accurate) amounts.

The default value was set to 1000 back in November 2013, so this amount should be safe. +1 Satoshi is used as marker. Increment further, if a new marker is needed.

The `minrelaytxfee` can be set via bitcoin.conf or startup parameter. Note: `minrelaytxfee=0.00001001` in decimal form must used! Verify via `getinfo` and look out for `relayfee`.

3. `DEFAULT_TRANSACTION_FEE` was set to 10000 from 0.

This simply mirrors the actual default value and has no effect, unless the mintxfee is overwritten. In this case all it does is to act as safeguard for the case that only `mintxfee` was set and `paytxfee` was forgotten.

---

Get minimum output amount to be spent by an output based on scriptPubKey size in relation to the minimum relay fee.

The minimum relay fee can be defined as command-line argument `-minrelayfee=` or `minrelayfee=` in bitcoin.conf.

As per default `minrelayfee=0.00001` is used which results in the following dust limits:

- Pay-to-pubkey-hash (34 byte): 0.00000546 BTC
- Multisig, two compressed public keys (80 byte): 0.00000684 BTC
- Multisig, one compressed, one uncompressed public key (112 byte): 0.00000780 BTC
- Multisig, three compressed public keys (114 byte): 0.00000786 BTC
- Multisig, one uncompressed, two compressed public keys (146 byte): 0.00000882 BTC

Related:

- core.h: bool IsDust(int64_t nMinRelayTxFee)
- init.cpp: int64_t CTransaction::nMinRelayTxFee