mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01:00
Merge bitcoin/bitcoin#24494: wallet: generate random change target for each tx for better privacy
9053f64fcb[doc] release notes for random change target (glozow)46f2fed6c5[wallet] remove MIN_CHANGE (glozow)a44236addd[wallet] randomly generate change targets (glozow)1e52e6bd0arefactor coin selection for parameterizable change target (glozow) Pull request description: Closes #24458 - the wallet always chooses 1 million sats as its change target, making it easier to fingerprint transactions created by the Core wallet. Instead of using a fixed value, choose one randomly each time (within a range). Using 50ksat (around $20) as the lower bound and `min(1 million sat, 2 * average payment value)` as the upper bound. RFC: If the payment is <25ksat, this doesn't work, so we're using the range (payment amount, 50ksat) instead. ACKs for top commit: achow101: ACK9053f64fcbXekyo: reACK9053f64fcbTree-SHA512: 45ce5d064697065549473347648e29935733f3deffc71a6ab995449431f60302d1f9911a0994dfdb960b48c48b5d8859f168b396ff2a62db67d535a7db041d35
This commit is contained in:
@@ -33,7 +33,6 @@
|
||||
#include <QTreeWidget>
|
||||
|
||||
using wallet::CCoinControl;
|
||||
using wallet::MIN_CHANGE;
|
||||
|
||||
QList<CAmount> CoinControlDialog::payAmounts;
|
||||
bool CoinControlDialog::fSubtractFeeFromAmount = false;
|
||||
@@ -486,11 +485,10 @@ void CoinControlDialog::updateLabels(CCoinControl& m_coin_control, WalletModel *
|
||||
if (!CoinControlDialog::fSubtractFeeFromAmount)
|
||||
nChange -= nPayFee;
|
||||
|
||||
// Never create dust outputs; if we would, just add the dust to the fee.
|
||||
if (nChange > 0 && nChange < MIN_CHANGE)
|
||||
{
|
||||
if (nChange > 0) {
|
||||
// Assumes a p2pkh script size
|
||||
CTxOut txout(nChange, CScript() << std::vector<unsigned char>(24, 0));
|
||||
// Never create dust outputs; if we would, just add the dust to the fee.
|
||||
if (IsDust(txout, model->node().getDustRelayFee()))
|
||||
{
|
||||
nPayFee += nChange;
|
||||
|
||||
Reference in New Issue
Block a user