Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow duplicate addresses to be used in Qi tx inputs #2270

Merged
merged 1 commit into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions core/state_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -982,10 +982,6 @@ func ValidateQiTxInputs(tx *types.Transaction, chain ChainContext, db ethdb.Read
if !address.Equal(entryAddr) {
return nil, fmt.Errorf("tx %032x spends UTXO %032x:%d with invalid pubkey, have %s want %s", tx.Hash(), txIn.PreviousOutPoint.TxHash, txIn.PreviousOutPoint.Index, address.String(), entryAddr.String())
}
// Check for duplicate addresses. This also checks for duplicate inputs.
if _, exists := addresses[common.AddressBytes(utxo.Address)]; exists {
return nil, errors.New("Duplicate address in QiTx inputs: " + common.AddressBytes(utxo.Address).String())
}
addresses[common.AddressBytes(utxo.Address)] = struct{}{}

// Perform some spend processing logic
Expand Down Expand Up @@ -1224,10 +1220,6 @@ func ProcessQiTx(tx *types.Transaction, chain ChainContext, checkSig bool, isFir
}
pubKeys = append(pubKeys, pubKey)
}
// Check for duplicate addresses. This also checks for duplicate inputs.
if _, exists := addresses[common.AddressBytes(utxo.Address)]; exists {
return nil, nil, nil, errors.New("Duplicate address in QiTx inputs: " + common.AddressBytes(utxo.Address).String()), nil
}
addresses[common.AddressBytes(utxo.Address)] = struct{}{}

// Perform some spend processing logic
Expand Down
4 changes: 0 additions & 4 deletions core/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -2004,10 +2004,6 @@ func (w *worker) processQiTx(tx *types.Transaction, env *environment, primeTermi
types.MaxDenomination)
return errors.New(str)
}
// Check for duplicate addresses. This also checks for duplicate inputs.
if _, exists := addresses[common.AddressBytes(utxo.Address)]; exists {
return errors.New("Duplicate address in QiTx inputs: " + common.AddressBytes(utxo.Address).String())
}
addresses[common.AddressBytes(utxo.Address)] = struct{}{}
totalQitIn.Add(totalQitIn, types.Denominations[denomination])
utxoHash := types.UTXOHash(txIn.PreviousOutPoint.TxHash, txIn.PreviousOutPoint.Index, utxo)
Expand Down
Loading