anchor.diff:        ErrorNum := CT_RPC_ErrNum_NotAllowedCall;
         Exit;
       end;
  -    jsonresponse.GetAsVariant('result').Value := _RPCServer.WalletKeys.LockWallet;
  +    FNode.OperationSequenceLock.Acquire;  // Use lock to prevent N_Operation race-condition on concurrent invocations
  +    try
  +      jsonresponse.GetAsVariant('result').Value := _RPCServer.WalletKeys.LockWallet;
  +    finally
  +      FNode.OperationSequenceLock.Release;
  +    end;
       Result := true;
     end else if (method='unlock') then begin
       // Unlocks the Wallet with "pwd" password
  
positive.code:       ErrorDesc := 'Need param "pwd"';
        exit;
      end;
      _RPCServer.WalletKeys.WalletPassword:=params.AsString('pwd','');
      jsonresponse.GetAsVariant('result').Value := _RPCServer.WalletKeys.IsValidPassword;
      Result := true;
    end else if (method='stopnode') then begin
      // Stops communications to other nodes
      if (Not _RPCServer.AllowUsePrivateKeys) then begin
  
negative.code:       ErrorDesc := 'Need param "pwd"';
        exit;
      end;
      FNode.OperationSequenceLock.Acquire;  // Use lock to prevent N_Operation race-condition on concurrent invocations
      try
        If Not _RPCServer.WalletKeys.IsValidPassword then begin
          _RPCServer.WalletKeys.WalletPassword:=params.AsString('pwd','');
        end;
        jsonresponse.GetAsVariant('result').Value := _RPCServer.WalletKeys.IsValidPassword;
        Result := true;
      finally
        FNode.OperationSequenceLock.Release;
      end;
    end else if (method='setwalletpassword') then begin
      // Changes the Wallet password with "pwd" param
      // Must be unlocked first
  