mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2025-02-25 15:10:18 +01:00
TransactionInput: treat duplicate connection attempts as a success.
This commit is contained in:
parent
a5ed2d63d3
commit
cf4c469e6e
1 changed files with 4 additions and 1 deletions
|
@ -325,7 +325,10 @@ public class TransactionInput extends ChildMessage implements Serializable {
|
|||
checkElementIndex((int) outpoint.getIndex(), transaction.getOutputs().size(), "Corrupt transaction");
|
||||
TransactionOutput out = transaction.getOutput((int) outpoint.getIndex());
|
||||
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();
|
||||
} else if (mode == ConnectMode.ABORT_ON_CONFLICT) {
|
||||
outpoint.fromTx = checkNotNull(out.parentTransaction);
|
||||
|
|
Loading…
Add table
Reference in a new issue