3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-01-31 23:32:16 +00:00

TransactionInput: treat duplicate connection attempts as a success.

This commit is contained in:
Mike Hearn 2013-07-25 15:30:49 +02:00
parent a5ed2d63d3
commit cf4c469e6e

View File

@ -325,7 +325,10 @@ public class TransactionInput extends ChildMessage implements Serializable {
checkElementIndex((int) outpoint.getIndex(), transaction.getOutputs().size(), "Corrupt transaction"); checkElementIndex((int) outpoint.getIndex(), transaction.getOutputs().size(), "Corrupt transaction");
TransactionOutput out = transaction.getOutput((int) outpoint.getIndex()); TransactionOutput out = transaction.getOutput((int) outpoint.getIndex());
if (!out.isAvailableForSpending()) { if (!out.isAvailableForSpending()) {
if (mode == ConnectMode.DISCONNECT_ON_CONFLICT) { if (out.parentTransaction.equals(outpoint.fromTx)) {
// Already connected.
return ConnectionResult.SUCCESS;
} else if (mode == ConnectMode.DISCONNECT_ON_CONFLICT) {
out.markAsUnspent(); out.markAsUnspent();
} else if (mode == ConnectMode.ABORT_ON_CONFLICT) { } else if (mode == ConnectMode.ABORT_ON_CONFLICT) {
outpoint.fromTx = checkNotNull(out.parentTransaction); outpoint.fromTx = checkNotNull(out.parentTransaction);