mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 15:09:59 +01:00
Delete error-prone CScript constructor
This commit is contained in:
@@ -422,7 +422,8 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog)
|
||||
|
||||
if (amount > 0)
|
||||
{
|
||||
CTxOut txout(amount, static_cast<CScript>(std::vector<unsigned char>(24, 0)));
|
||||
// Assumes a p2pkh script size
|
||||
CTxOut txout(amount, CScript() << std::vector<unsigned char>(24, 0));
|
||||
txDummy.vout.push_back(txout);
|
||||
fDust |= IsDust(txout, model->node().getDustRelayFee());
|
||||
}
|
||||
@@ -513,7 +514,8 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog)
|
||||
// Never create dust outputs; if we would, just add the dust to the fee.
|
||||
if (nChange > 0 && nChange < MIN_CHANGE)
|
||||
{
|
||||
CTxOut txout(nChange, static_cast<CScript>(std::vector<unsigned char>(24, 0)));
|
||||
// Assumes a p2pkh script size
|
||||
CTxOut txout(nChange, CScript() << std::vector<unsigned char>(24, 0));
|
||||
if (IsDust(txout, model->node().getDustRelayFee()))
|
||||
{
|
||||
nPayFee += nChange;
|
||||
|
||||
Reference in New Issue
Block a user