@@ -397,13 +397,13 @@ func (n *Node) GetUTXO(txid string, vout uint32, address string, startHeight int
397397 }
398398
399399 if address == "" {
400- return nil , errors . New ("address is required: neutrino uses compact block filters which match on scripts, not outpoints" )
400+ return nil , NewBadRequestError ("address is required: neutrino uses compact block filters which match on scripts, not outpoints" )
401401 }
402402
403403 // Parse the address to get the pkScript
404404 addr , err := btcutil .DecodeAddress (address , n .chainParams )
405405 if err != nil {
406- return nil , fmt .Errorf ("invalid address %s: %w " , address , err )
406+ return nil , NewBadRequestError ( fmt .Sprintf ("invalid address %s: %v " , address , err ) )
407407 }
408408
409409 pkScript , err := txscript .PayToAddrScript (addr )
@@ -414,7 +414,7 @@ func (n *Node) GetUTXO(txid string, vout uint32, address string, startHeight int
414414 // Parse txid
415415 targetHash , err := chainhash .NewHashFromStr (txid )
416416 if err != nil {
417- return nil , fmt .Errorf ("invalid txid: %w " , err )
417+ return nil , NewBadRequestError ( fmt .Sprintf ("invalid txid: %v " , err ) )
418418 }
419419
420420 n .logger .Infof ("Looking up UTXO %s:%d for address %s starting from height %d" , txid , vout , address , startHeight )
@@ -513,7 +513,7 @@ func (n *Node) GetUTXO(txid string, vout uint32, address string, startHeight int
513513
514514 // Build response
515515 if foundTx == nil {
516- return nil , fmt . Errorf ( "UTXO not found: ensure start_height is at or before the block containing the transaction" )
516+ return nil , NewNotFoundError ( "UTXO" , "UTXO not found: ensure start_height is at or before the block containing the transaction" )
517517 }
518518
519519 report := & UTXOSpendReport {}
0 commit comments