Skip to content

Commit

Permalink
fix(SPV-000): proper error on SPV failure (#125)
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-4chain authored Oct 11, 2024
1 parent b1a379f commit 5e6ad17
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 0 additions & 2 deletions dns_sec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,8 @@ func TestClient_CheckDNSSEC(t *testing.T) {
{"---", true},
{"---.---", true},
{"*.---", true},
{"moneybutton", true},
{"asdfadfasdfasdfasdf10909.com", true},
{"google.com", false},
{"moneybutton.com", true},
// {"relayx.io", false}, // Disabled for timeout issues
{"cloudflare.com", false},
{"mrz1836.com", false},
Expand Down
3 changes: 3 additions & 0 deletions errors/definitions.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,7 @@ var (

// ErrNoMatchingTransactionsForInput is when no matching transaction for input can be found
ErrNoMatchingTransactionsForInput = SPVError{Message: "invalid parent transactions, no matching transactions for input", StatusCode: 417, Code: "error-spv-bump-ancestor-not-present"}

// ErrSPVFailed is when the SPV returns an error
ErrSPVFailed = SPVError{Message: "simplified payment verification has failed", StatusCode: 417, Code: "error-spv-failed"}
)
2 changes: 1 addition & 1 deletion server/p2p_receive_transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func (c *Configuration) p2pReceiveBeefTx(context *gin.Context) {

err = spv.ExecuteSimplifiedPaymentVerification(context.Request.Context(), dBeef, c.actions)
if err != nil {
errors.ErrorResponse(context, errors.ErrNoOutputs)
errors.ErrorResponse(context, errors.ErrSPVFailed)
return
}

Expand Down

0 comments on commit 5e6ad17

Please sign in to comment.