Skip to content

Commit

Permalink
feat: RBF supports
Browse files Browse the repository at this point in the history
  • Loading branch information
cevin committed Dec 27, 2023
1 parent 1552080 commit ba8008d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
21 changes: 21 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ import (
"flag"
"github.com/labstack/echo/v4"
"github.com/labstack/echo/v4/middleware"
"runtime"
)

var (
version string
gitCommitHash string
)

func main() {
Expand All @@ -21,6 +27,21 @@ func main() {

app.RouteNotFound("/*", web.DefaultNotFound)

// info
app.Any("/", func(c echo.Context) error {
return c.JSON(200, struct {
Code int `json:"code"`
Version string `json:"version"`
GoVersion string `json:"go-version"`
GitHash string `json:"git-commit-hash"`
}{
Code: 200,
Version: version,
GoVersion: runtime.Version(),
GitHash: gitCommitHash,
})
})

// addresses
app.Match([]string{"GET", "POST"}, "/address/new", web.NewAddress)
app.Match([]string{"GET", "POST"}, "/address/parse", web.ParseAddress)
Expand Down
1 change: 1 addition & 0 deletions utils/btc/btc.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ func CreateRawTransaction(inputs Inputs, outputs Outputs) (*wire.MsgTx, error) {

prevOut := wire.NewOutPoint(txHash, uint32(input.VOut))
txIn := wire.NewTxIn(prevOut, nil, nil)
txIn.Sequence = wire.MaxTxInSequenceNum - 2
tx.AddTxIn(txIn)
}

Expand Down

0 comments on commit ba8008d

Please sign in to comment.