Browse Source

Dust outputs: Fix condition (one OP_RETURN was avoiding checks on other outputs)

patch-2
Esteban Ordano 10 years ago
parent
commit
9cafbd558d
  1. 10
      lib/transaction/transaction.js

10
lib/transaction/transaction.js

@ -151,12 +151,10 @@ Transaction.prototype._validateChange = function() {
Transaction.DUST_AMOUNT = 5460;
Transaction.prototype._hasDustOutputs = function() {
var output;
for (output in this.outputs) {
if (this.outputs[output].script.isDataOut()) {
return false;
}
if (this.outputs[output].satoshis < Transaction.DUST_AMOUNT) {
var index, output;
for (index in this.outputs) {
output = this.outputs[index];
if (output.satoshis < Transaction.DUST_AMOUNT && !output.script.isDataOut()) {
return true;
}
}

Loading…
Cancel
Save