Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion common/darkside.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ func DarksideReset(sa int, bi, cn string, sst, sot, sit uint32) error {
return nil
}

// DarksideAddBlock adds a single block to the active blocks list.
// addBlockActive adds a single block to the active blocks list.
func addBlockActive(blockBytes []byte) error {
block := parser.NewBlock()
rest, err := block.ParseFromSlice(blockBytes)
Expand Down
5 changes: 1 addition & 4 deletions frontend/frontend_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1450,10 +1450,7 @@ func (tg *testgetsubtreeroots) Send(sr *walletrpc.SubtreeRoot) error {
return nil
}

// An unrecognized ShieldedProtocol is the caller's mistake, so it must arrive as
// InvalidArgument. Returning a bare error made it codes.Unknown -- "something went
// wrong on the server" -- which is the code wallets back off and retry on, for a
// request that can never succeed.
// An unrecognized ShieldedProtocol must arrive as InvalidArgument, not Unknown.
func TestGetSubtreeRootsUnknownProtocolIsInvalidArgument(t *testing.T) {
testT = t
defer resetGlobals()
Expand Down
10 changes: 3 additions & 7 deletions frontend/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,8 @@ func (s *lwdStreamer) GetLatestBlock(ctx context.Context, placeholder *walletrpc
// address-index scan (GHSA-x4m7-3gpp-xc36, finding 2).
const maxTaddrTxBlockSpan = 10_000_000

// GetTaddressTxids is a streaming RPC that returns transactions that have
// the given transparent address (taddr) as either an input or output.
// NB, this method is misnamed, it does not return txids.
// GetTaddressTransactions is a streaming RPC that returns transactions that
// have the given transparent address (taddr) as either an input or output.
func (s *lwdStreamer) GetTaddressTransactions(addressBlockFilter *walletrpc.TransparentAddressBlockFilter, resp walletrpc.CompactTxStreamer_GetTaddressTransactionsServer) error {
common.Log.Debugf("gRPC GetTaddressTransactions(%+v)\n", addressBlockFilter)
if err := checkTaddress(addressBlockFilter.Address); err != nil {
Expand Down Expand Up @@ -1008,10 +1007,7 @@ func (s *lwdStreamer) GetSubtreeRoots(arg *walletrpc.GetSubtreeRootsArg, resp wa
case walletrpc.ShieldedProtocol_ironwood:
break
default:
// A status error, like every other rejection of client input here: a bare
// error reaches the client as codes.Unknown, which is the code for "something
// went wrong on the server". Wallets retry that. An unrecognized protocol is
// the caller's to fix, and InvalidArgument is what says so.
// A bare error would reach the client as codes.Unknown, which wallets retry.
return status.Errorf(codes.InvalidArgument,
"GetSubtreeRoots: unrecognized shielded protocol: %s", arg.ShieldedProtocol)
}
Expand Down
Loading