dogecoin/libdohj

Litecoin minNonDustOutput is wrong?

mrosseel opened this issue · 1 comments

According to the following site:
https://litecoin.info/Transaction_fees
The minimum non-dust output of litecoin is 0.001 LTC.

In the AbstractLitecoinParams.java file this parameter is set to Coin.COIN:

@Override
public Coin getMinNonDustOutput() {
    return Coin.COIN;
}

Which is 1 LTC:

/**
 * The number of satoshis equal to one bitcoin.
 */
private static final long COIN_VALUE = LongMath.pow(10, SMALLEST_UNIT_EXPONENT);

/**
 * One Bitcoin.
 */
public static final Coin COIN = Coin.valueOf(COIN_VALUE);

Note: in Doge it's also set to 1 Doge (litecoin probably copy-pasted this), in namecoin it's set to the bitcoin default Transaction.MIN_NONDUST_OUTPUT; which is 2730 satoshi.

Proposal:

@Override
public Coin getMinNonDustOutput() {
    return Coin.valueof(100000);
}

Can anyone confirm this interpretation?
Should the other values in that table be checked as well?

When I created the Namecoin params, I just copied what BitcoinJ did for Bitcoin. I actually don't see the constant 2730 in either the Bitcoin Core or Namecoin Core source code. I do see this commit: bitcoin/bitcoin@5f46a7d , which removed a constant of 2730. So maybe the Bitcoin params in upstream BitcoinJ also need fixing?