Skip to content

Commit

Permalink
Allow duplicate addresses to be used in Qi tx inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
jdowning100 committed Oct 18, 2024
1 parent 86dd208 commit 7201fc7
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 12 deletions.
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

0 comments on commit 7201fc7

Please sign in to comment.