File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
pkg/code/server/transaction Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ import (
2525 "github.com/code-payments/code-server/pkg/code/data/action"
2626 "github.com/code-payments/code-server/pkg/code/data/fulfillment"
2727 "github.com/code-payments/code-server/pkg/code/data/intent"
28+ "github.com/code-payments/code-server/pkg/code/data/timelock"
2829 "github.com/code-payments/code-server/pkg/code/transaction"
2930 currency_lib "github.com/code-payments/code-server/pkg/currency"
3031 "github.com/code-payments/code-server/pkg/grpc/client"
@@ -850,7 +851,18 @@ func (s *transactionServer) CanWithdrawToAccount(ctx context.Context, req *trans
850851 // If not, indicate to the client to pay a fee for a create-on-send withdrawal.
851852 //
852853
853- if ! isOnCurve {
854+ var isVmDepositPda bool
855+ _ , err = s .data .GetTimelockByDepositPda (ctx , accountToCheck .PublicKey ().ToBase58 ())
856+ switch err {
857+ case nil :
858+ isVmDepositPda = true
859+ case timelock .ErrTimelockNotFound :
860+ default :
861+ log .WithError (err ).Warn ("failure checking timelock db as a deposit pda account" )
862+ return nil , status .Error (codes .Internal , "" )
863+ }
864+
865+ if ! isOnCurve && ! isVmDepositPda {
854866 return & transactionpb.CanWithdrawToAccountResponse {
855867 IsValidPaymentDestination : false ,
856868 AccountType : transactionpb .CanWithdrawToAccountResponse_Unknown ,
You can’t perform that action at this time.
0 commit comments