Skip to content

Commit

Permalink
rpcserver: return the plain reject reason from btcd
Browse files Browse the repository at this point in the history
This commit changes the `RejectReason` resulted from calling
btcd's `testmempoolaccept` to be un-matched, leaving it to the caller to
decide when and where to match it.
  • Loading branch information
yyforyongyu committed Mar 18, 2024
1 parent 36683e0 commit 8abf969
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions rpcserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ import (
"github.com/btcsuite/btcd/mining"
"github.com/btcsuite/btcd/mining/cpuminer"
"github.com/btcsuite/btcd/peer"
"github.com/btcsuite/btcd/rpcclient"
"github.com/btcsuite/btcd/txscript"
"github.com/btcsuite/btcd/wire"
"github.com/btcsuite/websocket"
Expand Down Expand Up @@ -3858,9 +3857,7 @@ func handleTestMempoolAccept(s *rpcServer, cmd interface{},

// TODO(yy): differentiate the errors and put package
// error in `PackageError` field.
item.RejectReason = rpcclient.MapBtcdErrToRejectReason(
err,
)
item.RejectReason = err.Error()

results = append(results, item)

Expand Down

0 comments on commit 8abf969

Please sign in to comment.