Skip to content

Commit

Permalink
demo: printf SPV progress and results
Browse files Browse the repository at this point in the history
  • Loading branch information
arkadiuszos4chain committed Nov 28, 2023
1 parent 8349e62 commit d7a8bd8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions server/p2p_receive_transaction.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package server

import (
"fmt"
"net/http"

"github.com/bitcoin-sv/go-paymail"
Expand Down Expand Up @@ -87,12 +88,17 @@ func (c *Configuration) p2pReceiveBeefTx(w http.ResponseWriter, req *http.Reques
panic("empty beef after parsing!")
}

fmt.Println("SPV begin...")

err := paymail.ExecuteSimplifiedPaymentVerification(dBeef, c.actions)
if err != nil {
fmt.Println(fmt.Sprintf("SPV failed. Reason: %s", err.Error()))
ErrorResponse(w, ErrorSimplifiedPaymentVerification, err.Error(), http.StatusExpectationFailed)
return
}

fmt.Println("SPV coplete...")

var response *paymail.P2PTransactionPayload
if response, err = c.actions.RecordTransaction(
req.Context(), requestPayload.P2PTransaction, md,
Expand Down

0 comments on commit d7a8bd8

Please sign in to comment.