rpcserver: return the plain reject reason from btcd

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.
This commit is contained in:
yyforyongyu 2024-03-15 04:57:59 +08:00
parent 36683e0b96
commit 8abf969c3c
No known key found for this signature in database
GPG key ID: 9BCD95C4FF296868

View file

@ -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"
@ -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)