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 (
25
25
"github.com/code-payments/code-server/pkg/code/data/action"
26
26
"github.com/code-payments/code-server/pkg/code/data/fulfillment"
27
27
"github.com/code-payments/code-server/pkg/code/data/intent"
28
+ "github.com/code-payments/code-server/pkg/code/data/timelock"
28
29
"github.com/code-payments/code-server/pkg/code/transaction"
29
30
currency_lib "github.com/code-payments/code-server/pkg/currency"
30
31
"github.com/code-payments/code-server/pkg/grpc/client"
@@ -850,7 +851,18 @@ func (s *transactionServer) CanWithdrawToAccount(ctx context.Context, req *trans
850
851
// If not, indicate to the client to pay a fee for a create-on-send withdrawal.
851
852
//
852
853
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 {
854
866
return & transactionpb.CanWithdrawToAccountResponse {
855
867
IsValidPaymentDestination : false ,
856
868
AccountType : transactionpb .CanWithdrawToAccountResponse_Unknown ,
You can’t perform that action at this time.
0 commit comments