From de9c6b428e7d72afe3da1244d3f62c5b45f27625 Mon Sep 17 00:00:00 2001 From: David Hill Date: Fri, 31 Jul 2020 07:55:28 +0000 Subject: [PATCH] background: handle fee transaction doublespends (#164) --- .github/workflows/go.yml | 5 ++--- background/background.go | 7 +++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index f5ea97d..d89a81a 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -15,7 +15,7 @@ jobs: - name: Check out source uses: actions/checkout@v2 - name: Install Linters - run: "curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.28.0" + run: "curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.29.0" - name: Build env: GO111MODULE: "on" @@ -24,5 +24,4 @@ jobs: env: GO111MODULE: "on" run: | - export PATH=${PATH}:$(go env GOPATH)/bin - ./run_tests.sh \ No newline at end of file + ./run_tests.sh diff --git a/background/background.go b/background/background.go index 6628fa1..7e12764 100644 --- a/background/background.go +++ b/background/background.go @@ -164,6 +164,13 @@ func blockConnected() { if err != nil { log.Errorf("%s: dcrd.GetRawTransaction for fee tx failed (feeTxHash=%s, ticketHash=%s): %v", funcName, ticket.FeeTxHash, ticket.Hash, err) + + ticket.FeeTxStatus = database.FeeError + err = db.UpdateTicket(ticket) + if err != nil { + log.Errorf("%s: db.UpdateTicket error, failed to set fee tx status to error (ticketHash=%s): %v", + funcName, ticket.Hash, err) + } continue }